th width not working?

I needed to use the min-width:100px style instead of the width style.

Other issues I’ve found since include requiring CSS table { table-layout: fixed; width:100%; } as tables require a width be set for the columns to respect width.

Having a first row which contains any colspan can also be an issue, so I include an additional row as the first row which has no border and 0 height(essentially invisible) and has individual cells(no colspans) so that widths can be established by that first “fake” row, and then the second row with colspan’s doesn’t cause an issue. Note that you shouldn’t 0 out the padding/margin as you’d want that first row to have the same as other rows so that widths are properly established:

<tr class="scaffolding">...</tr>

tr.scaffolding, .scaffolding td {
    border:none;
    padding-top:0;
    padding-bottom:0;
    height:0;
    margin-top:0;
    margin-bottom:0;
    visibility:hidden;
}

Leave a Comment

error code: 521