DOUBLE TABLES FOR BORDERS

 

High Traffic AD spot for rent

Free Ad Quote

Live Help

1 204 344 5070

 
Here's a trick we use quite often to add a clean border to tables, without
having the border show up around every cell of our tables. What we want to
do is create a nice table, then have a solid black border all around it.
Here's what we do.

First, create your table (without borders):

<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
Some text ...
</td>
</tr>
</table>

Now we're going to wrap another table around this one, using a black
background and padding it with a value of "1" pixel. This will have the
effect of pushing the inner table inside by one pixel, which will show the
black background of the outer table, hence creating a nice 1 pixel black
border around our inner table.

<table width="600" border="0" cellpadding="1" cellspacing="0"
bgcolor="#000000"><tr></td>
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
Some text ...
</td>
</tr>
</table>
</td></tr></table>

Of course, you can change the bgcolor to whatever you want, and even add a
pixel or two to make a fatter border. Play with this technique and your
tables will look awesome!