TABLE Data Display - Cellspacing
The following examples show you what your table will look like when you use the "cellpadding" attribute in your table. Like Cellpadding, Cellspacing is not available for the <tr>, <th> or <td> elements.
Example 1 Using Cellspacing in your Table
<tr> <td align="center"> <table width="500" bgcolor="#FFFF00" border="7" style="border-color:#900" cellpadding="0" cellspacing="0"> <tr class="trtext1"> <th width="60%" bgcolor="#99FF99" align="center">File Name</th> <th width="40%" align="center">Submitter</th> </tr> <tr bgcolor="#FFFF99"> <td bgcolor="#FF6699" align="left">File for research purposes</td> <td align="center">Bryant Walker</td> </tr> </table> </td> </tr> |
||||
|
This example shows color added to two cells; cell 1 of the header row 1 and cell 2 of the second row. It is also an example of no "cellspacing" in the table.
Example 2 No color and cellspacing is added to the table.
<tr> <td width="300" align="center"> <table border="7" style="border-color:#900" cellpadding="5" cellspacing="20"> <tr> <th width="60%" align="center">File Name</th> <th width="40%" align="center">Submitter</th> </tr> <tr> <td align="left">File for research purposes</td> <td align="center">Bryant Walker</td> </tr> </table> </td> </tr> |
||||
|
The table in the second example has a background color because the simulated page was given a background color. Otherwise, it would not have a color. Cellspacing (20px) was added to the table to demonstrate what it looks like with a large amount of cellspacing pixels for spacing between the cells. This exagerated example gives you some idea of what cellspacing does to the table.
Cellspacing is a useful attribute and is often used to set up the display tables for numerical data.