Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent a <td> from being too high?

It must be something stupid, but I can't figure it out so far...

Here is my HTML:

<table cellspacing="0" cellpadding="0" border="0">
<tr>
    <td style="height: 8px"><img src="/media/note2.png" width="8" height="8" border="0"></td>
    <td style="height: 8px"></td>
    <td style="height: 8px"><img src="/media/note1.png" width="8" height="8" border="0"></td>
</tr>
<tr>
    <td class="NoteCell"></td>
    <td class="NoteCell">{{ text }}</td>
    <td class="NoteCell"></td>
</tr>
<tr>
    <td style="height: 8px"><img src="/media/note4.png" width="8" height="8" border="0"></td>
    <td style="height: 8px"></td>
    <td style="height: 8px"><img src="/media/note3.png" width="8" height="8" border="0"></td>
</tr>

I'm expecting the first and third rows to have a height of 8 pixels, but for some reason they are much higher (as if there was text inside, but there is no text!)

Puzzled... Any help will be appreciated!

like image 543
Ilya Kogan Avatar asked May 15 '10 07:05

Ilya Kogan


People also ask

What is TD in table?

<td>: The Table Data Cell element. The <td> HTML element defines a cell of a table that contains data.

What is TD in HTML?

The <td> tag defines a standard data cell in an HTML table. An HTML table has two kinds of cells: Header cells - contains header information (created with the <th> element)


1 Answers

Try td img { display: block; }

like image 163
Alohci Avatar answered Sep 27 '22 16:09

Alohci