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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:26:51+00:00 2026-06-16T14:26:51+00:00

I want the table to have 100% width, but only one column from it

  • 0

I want the table to have 100% width, but only one column from it should have a free width, like:

| A | B | C                                                                  |

so the width of A and B columns should match the width of their contents, but the width of C should go on until the table ends.

Ok I could specify the width of of A and B in pixels, but the problem is that the width of the contents of these columns is not fixed, so if I set a fixed width it wouldn’t match the contents perfectly 🙁

PS: I’m not using actual table items, but a DL list wrapped in a div. The div has display:table, dl has display:table-row, and dt/dd display:table-cell …

  • 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-16T14:26:52+00:00Added an answer on June 16, 2026 at 2:26 pm

    If I understood you, you have tabular data but you want to present it in the browser using div elements (AFAIK tables and divs with display:table behaves mostly the same).

    (here is a working jsfiddle: http://jsfiddle.net/roimergarcia/CWKRA/)

    The markup:

    <div class='theTable'>
        <div class='theRow'>
            <div class='theCell' >first</div>
            <div class='theCell' >test</div>
            <div class='theCell bigCell'>this is long</div>
        </div>
        <div class='theRow'>
            <div class='theCell'>2nd</div>
            <div class='theCell'>more test</div>
            <div class='theCell'>it is still long</div>
        </div>
    </div>​
    

    And the CSS:

    .theTable{
        display:table; 
        width:95%; /* or whatever width for your table*/
    }
    .theRow{display:table-row}
    .theCell{
        display:table-cell;
        padding: 0px 2px; /* just some padding, if needed*/
        white-space: pre; /* this will avoid line breaks*/
    }
    .bigCell{
        width:100%; /* this will shrink other cells */
    }​
    

    The sad part is I couldn’t do this one year ago, when I really needed it -_-!

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

Sidebar

Related Questions

I have table a joining table b, I only want the records from table
I have one table which display data as from Dynamic Content, I want to
I want to select everything from table one, which contains a column JID. These
I have a table and want to get 15 values with one order and
i have users table and i have posts table i want select from users
i have table with filmname and actors column in sql server 2005 i want
I have table with 3 columns A B C. I want to select *
I have a table with around 100,000 rows at the moment. I want to
I have a data table containing two columns (pattern and neworder) and cca 100
I currently have this as a loop in my code, <table width=100% cellpadding=0 cellspacing=0

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.