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

  • Home
  • SEARCH
  • 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 8127391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:30:50+00:00 2026-06-06T07:30:50+00:00

I’m trying to set the last three columns to be as small as possible

  • 0

I’m trying to set the last three columns to be as small as possible since they’re just holding icons/links for actions.

I’d also want to the large text columns to have as much of the remaining width as possible.

Here’s what I was able to find, but didn’t work for me:

Two columns table : one as small as possible, the other takes the rest

This solution doesn’t work for me because I have multiple columns that I want to take up as much space as possible, so I can’t set any of them to width = 100%.

force column size to smallest possible

I tried using relative lengths (width=”*”), but it doesn’t seem to have any effect. Maybe it’s because I didn’t set any widths prior so there’s no ‘remaining width’ to distribute out?

HTML:

<table>
  <colgroup class='data' span='5'>
    <col class='date' span='1'/>
    <col class='id' span='1'/>
    <col class='title' span='1'/>
    <col class='status' span='1'/>
    <col class='description' span='1'/>
  </colgroup>
  <colgroup class='action' span='3'>
    <col class='show' span='1'/>
    <col class='edit' span='1'/>
    <col class='delete' span='1'/>
  </colgroup>
  <tr>
    <th>Date</th>
    <th>ID</th>
    <th>Title</th>
    <th>Status</th>
    <th>Description</th>
    <th colspan='3'></th>
  </tr>

  <tr>
    <td class='date'>medium</td>
    <td class='id'>medium</td>
    <td class='title'>large</td>
    <td class='status'>medium</td>
    <td class='description'>large</td>
    <td class='show'>small</td>
    <td class='edit'>small</td>
    <td class='delete'>small</td>
  </tr>
</table>

CSS:

table {
  width: 100%;
}

table td.title, td.description {
  text-align: left;
}

table td.date, td.id, td.status {
 text-align: center;
}

table td.show, td.edit, td.delete {
}

table colgroup.action col {
  width:"1*";
}

table colgroup.data col {
  width:"*";
}

So in the order of priority:

  • table spans entire width of parent container

  • the last three icon/action columns to be as small as possible without any cutoff

  • the columns with ‘large’ data (class title and description) should take up as much of the remaining space as possible

  • the columns with ‘medium’ data should be the size of their content with some margin on both sides (I don’t mind just throwing in a fixed width if it’s too difficult to accomplish this)

I don’t need the colgroup and col tags, but I just left them in here in case they can be useful. I’ve tried different permutations of using and not using them, but still can’t seem to get it to work. I also thought about using percents for the data columns, but I’d want the browser to determine the widths based on the actual content rather than me imposing predefined rules that might not be optimal.

  • 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-06T07:30:52+00:00Added an answer on June 6, 2026 at 7:30 am

    To answer one of your requests:

    the last three icon/action columns to be as small as possible without
    any cutoff

    To do this, I would float the tds or set them to display:inline-block;

    If you know the size of the icons you are using, you can then set the width on the th above the icons (which I would call class="icons").

    If you don’t know the width, you could calculate using some jQuery.

    var a = $('td.show').width();
    var b = $('td.edit').width();
    var c = $('td.delete').width();
    
    $('.icons').css('width', a+b+c+6+"px");
    

    Example: http://jsfiddle.net/KQs2K/1/

    Extra 6px needed to pad out the border bits I threw in the example

    Note: these tds will stack when the screen size gets real small.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.