Saturday, October 20, 2012

HTML Table Tag 4


Chapter 12


HTML Table cellpadding & cellspacing

For cellpadding 

Example 11:

<html>
<body>

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

<h4>With cellpadding:</h4>
<table border="1" 
cellpadding="10">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>   
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

</body>
</html>

Output is:

Without cellpadding:

FirstRow
SecondRow

With cellpadding:

FirstRow
SecondRow

For cellspacing

Example :12

<html>
<body>

<h4>Without cellspacing:</h4>
<table border="1">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>   
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

<h4>With cellspacing:</h4>
<table border="1" 
cellspacing="20">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>   
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

</body>
</html>

Output is:

Without cellspacing:

FirstRow
SecondRow

With cellspacing:

FirstRow
SecondRow

No comments:

Post a Comment