What does CSS width attribute mean in HTML table when layout is automatic?

lucatony_22

New Member
If I specify a width for a \[code\]<th>\[/code\] element in a table, what does that mean in terms of the wider table if table-layout is not specified and defaults to automatic? Does such a width specify a minimum width for the entire column? If so, where is this specified - I cannot find anything in the HTML/CSS specs that says width is interpreted this way, yet Firefox and IE both seem to interpret the width this way.To put this in context, imagine a table of numeric data (e.g. production volumes) for the days of the week. The week days are the column headings. I want to cope with two conditions:
  • There is no data for a particular day, but I don't want the width of the column to collapse to some ugly minimum. Rather, I want to set that minimum.
  • When there are large numbers in columns, I want the width of the column to automatically expand to show the number in full.
When I specify a bunch of column widths as follows...\[code\]<tr><th style="width:3em">Sun</th><th style="width:3em">Mon</th><th style="width:3em">Tue</th>...etc</tr>\[/code\]... I achieve the result I'm looking for. However, can I rely on this?
 
Back
Top