PDA

View Full Version : [SOLVED] HTML Table Query



s.fox
December 24th, 2008, 05:00 PM
Hi,

Does anybody know why this table has a slight white border between all the cells? Not totally sure why it's showing it. The only border should be a black outline around the whole table.



<table align="center" style="border: 1px solid black;"><tr bgcolor='#FFC600'>
<td>1</td><td>Stone Roses</td><td>A group dedicated to the stone roses</td>
</tr><tr bgcolor='#C6FF00'>
<td>2</td><td>Beatles</td><td>A group dedicated to the beatles</td>
</tr><tr bgcolor='#FFC600'>
<td>3</td><td>Rolling Stones</td><td>A group dedicated to the rolling stones</td>
</tr><tr bgcolor='#C6FF00'>
<td>4</td><td>Slade</td><td>A group dedicated to slade</td>
</tr></table>

Any help would be much appreciated.

Ash R

ilrudie
December 24th, 2008, 05:48 PM
Use the border-collapse: collapse CSS property.

Reiger
December 24th, 2008, 05:50 PM
Yes, that one (table borders are a special kind of animal... savage too...). And you may find your table rendering browser works with a default padding/margin for cells that you may wish to override.

s.fox
December 27th, 2008, 01:43 PM
Thanks for the help. I did have a look at collapse but it didn't work last time I tried it. Does work now though. Must have done something wrong. Anyway, thanks for the help! Here is the table now as it stands. Only thing left to do now is change the hideous colours :P


<html>
<head>
<style type="text/css">
table.coll
{
border-collapse: collapse
}
</style>
</head>
<body>

<table class="coll" style="border: 1px solid black;" border="0">
<tr bgcolor='#FFC600'>
<td>1</td><td>Stone Roses</td><td>A group dedicated to the stone roses</td>
</tr><tr bgcolor='#C6FF00'>
<td>2</td><td>Beatles</td><td>A group dedicated to the beatles</td>
</tr><tr bgcolor='#FFC600'>
<td>3</td><td>Rolling Stones</td><td>A group dedicated to the rolling stones</td>
</tr><tr bgcolor='#C6FF00'>
<td>4</td><td>Slade</td><td>A group dedicated to slade</td>
</tr></table>
</body>
</html>