min-height and table cells

That Guy picture That Guy · Mar 25, 2012 · Viewed 31.1k times · Source

I've done a little bit of research on this, but I just wanted to ask to people who'd know much better than I.

Is it true that setting a height to a table cell only acts as min-height? I know this is true in Firefox, but what other browsers does this happen in?

Answer

Zmogas picture Zmogas · Jun 13, 2012

Short answer: YES. I tried to load following code:

<table border="0" style="background-color: yellow;">
    <tr style="background-color: green;">
        <td>row 0 cell 0</td>
        <td>row 0 cell 1</td>
    </tr>
    <tr style="background-color: green;">
        <td height="50">row 1 cell 0</td>
        <td>row 1 cell 1</td>
    </tr>
    <tr style="background-color: green;">
        <td style="height: 50px;">row 2 cell 0</td>
        <td>row 2 cell 1</td>
    </tr>
</table>

Both (height and style) work the same in browsers I tried:

  • Linux
    • Google chrome 19.0
    • Firefox 13.0
    • Konqueror 4.8
  • Windows
    • Google chrome 19.0
    • Firefox 12.0 and 13.0
    • Internet explorer 8
  • Android 2.3.3