I have to add an unnecessary span in my th elements in order to get the margin-top to work. Is there a CSS rule I can use to avoid this extra span?
CSS
table
{
width:100%;
border:4px solid gray;
padding:2px;
}
thead
{
background-color:gray;
}
th span
{
display:block;
margin-top:-4px;
}
th, td
{
padding:2px;
}
HTML
<table>
<thead>
<tr>
<th><span>Month</span></th>
<th><span>Amount</span></th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$200</td>
</tr>
</tbody>
</table>
Sure, here is your fiddle:
http://jsfiddle.net/VywK7/4/
CSS
HTML