April 28, 2009

0 Cell padding and Cell spacing

This tutorial shows how to use cell padding to create more white space between the cell content and its borders.Also this example shows how to use cellspacing to increase the distance between the cells




<html>

<body>
<h4>Without cellpadding</h4>
<table border="1">
<tr>
<td>First</td>
<td>Row</td>
</td>
<tr>
<td>Second</td>
<td>Row</td>
</td>
</tr>
</table>

<h4> with cell padding: </h4>
<table border="1" cellpadding="10">
<tr>
<td>First</td>
<td>Row</td>
</td>
<tr>
<td>Second</td>
<td>Row</td>
</td>
</tr>
</table>
</body>
</html>
<h4>With cellspacing: </h4>
<table border="1" cellspacing="10">
<tr>
<td>First</td>
<td>Row</td>
</td>
<tr>
<td>Second</td>
<td>Row</td>
</td>
</tr>
</table>




Without cellpadding












FirstRow
SecondRow


with cell padding:












FirstRow
SecondRow



With cellspacing:












FirstRow
SecondRow

0 comments:

Post a Comment

Blogger Themes

 
Powered by Blogger