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 7553691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:07:45+00:00 2026-05-30T11:07:45+00:00

i want a table to render with minimum width according to its content, but

  • 0

i want a table to render with minimum width according to its content, but IE7 insists on expanding it to 100% width.

The following little snippet works fine in Firefox and IE8, but not in IE7:

<!DOCTYPE HTML>
<html>
  <head>
    <style type="text/css">
      table { table-layout: fixed  }
      td { padding: 0 10px; border: 1px solid blue;}
    </style>
  </head>
  <body>
<table>
      <tr>
        <td>Column with variable width</td>
        <td style="width: 100px;">Column 2</td>
        <td style="width: 100px;">Column 3</td>
      </tr>
    </table>
  </body>
</html>
  • I have a table with table-layout: fixed.
  • I have specified the width of all cells except the first one.
  • In the first column, i want the browser to determine the width based on the content
  • As I don’t know the width of the first column, I cannot (and do not want to) specify the width of the table.

Now, the problem in IE7 is that the table is rendered to 100% width. So the first col has not the minimum width that is required to display its content but takes up all the space to make the table 100% width.

Here is what i found out so far:

  • when i remove “table-layout: fixed” from the table, the table will not expand to 100%. Unfortunatly, that’s not an option for me.
  • when i set the table-width to a very small size (like e.g. 10px), the first col will not be expanded to the minimum required width, but will disappear entirerly.
  • i tried to set “display: inline;” for the table, but that has no effects on the width.

Any ideas?

Thanks in advace,
Pitter

  • 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-05-30T11:07:47+00:00Added an answer on May 30, 2026 at 11:07 am

    If only purpose of table-layout: fixed is to fix widths of cells, then you can add DIVs with desired width inside TD and get rid of table-layout: fixed for table.

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

Sidebar

Related Questions

I have a query that does what i want joining table but i need
In a table I want to combine some of the columns, but not in
i want to save data in two table mysql, that was nice, but now
I want to update a table but the update SQL is not performed so
I render text with a custom table cell renderer and I want to trim
I'm styling a form by using a table with fixed-width columns and I want
I have the following problem with QT model/view framework. I want to render a
I want to render datalist to divs instead of table and the repeat columns
I want to add some class to row when I render a table, sample
I want to render each row with HTML code. The rendering works but -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.