Center image in table td in CSS

Best picture Best · Dec 22, 2011 · Viewed 362.2k times · Source

I've been trying to align an image to the center of the table td. It worked with setting margin-left to a specific value but it also increased the size of td too and that isn't exactly what I wanted

Is there any efficient ways of doing this? I used percentages for the height and witdh of the table.

Answer

Scott picture Scott · Dec 22, 2011
<td align="center">

or via css, which is the preferred method any more...

<td style="text-align: center;">