wiktus239 wiktus239 - 1 year ago 106
HTML Question

CSS padding for single TD inside a table

I have a table, constructed like this:

<tr> <td>1</td> <td>2</td> <td rowspan="4">3</td></tr>
<tr> <td>4</td> <td>5</td> </tr>
<tr> <td>6</td> <td>7</td> </tr>
<tr> <td>8</td> <td>9</td> </tr>
<tr height="100"><td colspan="2">10</td><td class="eleven">11</td> </tr>

Now the problem is within the last row. Whole row has a height set to 100px, so there is a plenty of room in TDs. In the very last TD I want to set an individual padding, so only the content "11" is padded from the top:

.eleven {

Setting this causes the problem - the first TD in this row also gets padding-top:10px; Why and how to make only the 2nd one padded?

Answer Source

Ok, I found out what caused the problem. It was an entry in a little html5-css-reset snippet I use:


assigned generally to most of common elements. Having that in mind, now everything works as supposed to.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download