views:

69

answers:

1

Basically I want the column widths on a table to ignore the size of the data. Excess data can be cutoff. Right now it is stretching the width of my columns even though I'm using table-layout:fixed. My expected behavior works in IE6 and 7 but not in anything else. Further if I remove my DTD then it will work just fine in IE8 but still not what I expect in FF/Chrome.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
    <body>
    <table border="1" cellspacing="0" cellpadding="5" style="table-layout:fixed;overflow:hidden;">
        <tr>
            <td width="50">
                -1,610,612,736.00
            </td>
            <td width="50">
                222
            </td>
        </tr>
        <tr>
            <td>33</td>
            <td>44</td>
        </tr>
    </table>
    </body>
</html>

Basically I want to have that long negative number be on 1 line and have the overflow cut off rather then adjusting the width of the column.

thanks!

A: 

One way to get what you want is to put each of the values in a <div> inside the < td>s, then set a width and overflow:hidden on the <div>s.

Another is to set overflow:hidden on the < td>s and set a width for the table.

Alohci
/facepalmI didn't know I needed a width on the table, thanks!I only have 13 rep so I can't up you, sorry.
numone