When a width value is applied to table cell, once the table width reaches the viewport width, the rule then becomes ignored, e.g.
td, th { width: 400px; }
I would expect a 10-column table to be (around) 4000px, but Firefox and Chrome only stretch out the table to the viewport width (see Fiddle). Upon which, the cell width isn't actually set to 400px. I read in the question below that table-layout:fixed
is used to force cell widths, but it doesn't work here.
Two similar questions exist here and here, but they only address initial widths, and don't discuss the viewport limitation.
Why does this happen please? I see there is a workaround...
td, th { min-width: 400px; max-width:400px; }
...but it just seems odd when width
alone should achieve exactly that purpose.