Scott Scott - 3 years ago 77
CSS Question

Centering an <img> in a <td>

I'm trying to center an image within a table using CSS. Stackoverflow had others with the same problem and solved them using

margin:0 auto, text-align:center
, and/or
. None of these is forcing the
to be centered within my table cells.

Answer Source

your img tag is getting float:left property coming from style.css

on line no. 16, add float:none property td img {
    border: 1px solid black;
    display: block;
    margin: 0 auto;
    text-align: center;
    float: none; // give this property !
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download