Forum Moderators: not2easy

Message Too Old, No Replies

problem with table element and margin

         

amonad

1:12 pm on Feb 8, 2010 (gmt 0)

10+ Year Member



Hi.
This is my HTML code:
<table><tr><td>Tekst</td></tr></table>

...and CSS:
table 
{
border:none;
background-color: #f00;
margin: 0;
padding: 0;
left: 0;
top: 0;
}
tr
{
border:none;
background-color: #00f;
padding: 0;
margin: 0;
left: 0;
top: 0;
}


Effect:
[kwarc.nazwa.pl ]

How can I eliminate this gap beetwen <tr> and <table> (red space)?

CSS_Kidd

2:42 pm on Feb 8, 2010 (gmt 0)

10+ Year Member



Try this:

<table cellspacing="0" cellpadding="0"><tr><td>Tekst</td></tr></table>

or use "border-spacing: 0" in your css for the table tag.

[w3.org ]

[w3schools.com ]