Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9205043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:51:30+00:00 2026-06-17T23:51:30+00:00

If I specify a width for a <th> element in a table, what does

  • 0

If I specify a width for a <th> 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…

<tr>
<th style="width:3em">Sun</th>
<th style="width:3em">Mon</th>
<th style="width:3em">Tue</th>
...etc
</tr>

… I achieve the result I’m looking for. However, can I rely on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:51:32+00:00Added an answer on June 17, 2026 at 11:51 pm

    Yes, you can rely on this; it’s in the CSS spec, and browsers play by the book here. For table cells, the width property sets the minimum width used in the calculation of column width.

    The spec is somewhat messy here, because the description of the width property does not say this or even refer to the description (as far as I can see), but this is described in section 17.5.2.2 Automatic table layout. Item 1 in the first numbered list there says: “Calculate the minimum content width (MCW) of each cell: the formatted content may span any number of lines but may not overflow the cell box. If the specified ‘width’ (W) of the cell is greater than MCW, W is the minimum cell width. A value of ‘auto’ means that MCW is the minimum cell width.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to specify table column width as is. In other words,
HTML table ignoring element-style width I have an HTML table where certain cells have
Does the width specified in the media queries represent the size of devide screen
I need to write SQL statement that will return an html table and specify
Is there any way to specify a width when doing :vsplit? Also, is there
How to Specify NOT with Regular Expressions for Words I want to filter a
What does standard specify about indexing sequence with Attr objects inside NamedNodeMap object? I
With Spring MVC, you can specify that a particular URL will handled by a
How to specify gem dependencies in a way that user with only ruby, rake
I'm wrestling with something that should be very simple - specify a sidebar at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.