PDA

View Full Version : How add html properties cellpadding and cellspacing to a table?



eliecerSR
19 Mar 2014, 7:59 AM
Ineed add the html properties cellpadding and cellspacing to a table.

scottmartin
19 Mar 2014, 8:50 AM
You should use css to perform this across the board or create a class for specific elements.



td {
padding: 10px;
}

eliecerSR
19 Mar 2014, 10:14 AM
How I use it?, Can you show me some example?

scottmartin
19 Mar 2014, 10:36 AM
Create a file called table.css ( or your preference )

// include this file in your html


<!DOCTYPE html>
<html>

<link rel="stylesheet" type="text/css" href="table.css"/>

<body>
<table width="30%" border="1">
<tr>
<td>Table row 1</td>
</tr>
<tr>
<td>Table row 2</td>
</tr>
</table>
</body>
</html>

scottmartin
19 Mar 2014, 10:42 AM
To expand on this, if you create a grid, it will do the same thing .. as it still creates a table.