How to correctly vertical align image+text inside table cell

css, html

Solution

Rather than using:

td {
    vertical-align: top;
}

Use:

td {
    vertical-align: baseline;
}
td img {
    vertical-align: top;
}

Problem

I need to `vertical-align:top` both 'Some text' and 'Other text'. The following is not working for me, only the second cell is aligned correctly. I don't understand what the problem is. ``` <style> td { vertical-align:top; } </style> <table> <tr> <td><img src="icon.png"/> Some text </td> <td> Other text </td> </tr> </table> ```

Original source