I found a very strange margin behaviour for table when it's inside LI element. Inside LI the TABLE has additional margin at the top which cannot be cancelled by using "margin" or "padding" CSS styles. The only way to cancel this -- is to set "display: block" for LI (by default it's "display: list-item"). Here is the code:
<!DOCTYPE html>
<html>
<head>
<title>Strange table margin behaviour</title>
</head>
<body>
<ul>
<li style="border: 1px solid #009; margin: 0; padding: 0;"><table style="border: 1px solid #ccc; margin: 0; padding: 0;"><tr><td>test</td></tr></table></li>
<li style="border: 1px solid #009; margin: 0; padding: 0;"><table style="border: 1px solid #ccc; margin: 0; padding: 0;"><tr><td>test</td></tr></table></li>
<li style="border: 1px solid #009; margin: 0; padding: 0;"><table style="border: 1px solid #ccc; margin: 0; padding: 0;"><tr><td>test</td></tr></table></li>
</ul>
</body>
</html>
This renders in Google Chrome as:
I expect:
I really not understand why this margin happens? LI itself does not have any paddings, TABLE does not have any margins, but together...
UPD. This margin appears only in Google Chrome (24.0.1312.68). In Mozilla Firefox (18.0.2) there is no margin, and page looks as expected (screenshot #2).