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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:45:02+00:00 2026-06-08T08:45:02+00:00

I have a table with a few columns in it and my second column

  • 0

I have a table with a few columns in it and my second column has a lot of text which pushes the other columns too far to the right. I want my table to stay put and if there is too much text in a column for it to get cut off. I should also probably mention that I am trying to avoid using table-layout:fixed and position:absolute. Here is my code:

HTML:

<table id="messages_list" class="listing rows clickable">
  <tbody>
    <tr>
      <th class="select"><input id="all" type="checkbox"></th>
      <th class="from">To</th>
      <th class="subject">Subject</th>
      <th class="date">Date</th>
    </tr>
    <tr class="item even " data-thread-id="16">
      <td class="first"><input class="checkbox" type="checkbox" name="id:16"></td>
      <td>LastName, FirstName, LastName2, FirstName2, LastName3, FirstName3, LastName4, FirstName4</td>
      <td>Hello</td>
      <td class="last">07/16/2012 12:26</td>
    </tr>
  </tbody>
</table>

CSS:

table.listing {
  border: 0;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 1em;
  overflow: hidden;
  white-space: nowrap;
}
table.listing th {
  padding: 4px 8px;
  font-size: 12px;
  background: #002A80;
  text-decoration: none !important;
  color: white !important;
  font-weight: bold;
  text-align: left;
}
th.select { 
  width: 10px; 
}
th.from { /* This is the column giving me problems */
  width: 20%;
  overflow: hidden;
}
th.date {
  width: 1%;
}

Live example: Tinkerbin.

  • 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-08T08:45:03+00:00Added an answer on June 8, 2026 at 8:45 am

    You are not actually applying overflow to the right cell. The th.from is only the header cell and although this is sufficient to set a width that overflow property will not go onto the other cells in that column.

    You’ll need to either set overflow: hidden on all td, use a second item type pseudo selector or easiest just put the from class on the td as well and style td.from and th.from the same.

    It seems that you’ll also need to set table-layout: fixed; on your table or something similar. Tables like to resize to fit their content and it seems that your whole table is resizing to fit in the content that you have explicitly told it not to wrap. I can’t tell you why it prefers to expand the table rather than hide the overflow but that’s tables for you.

    The table-layout property will tell it to render sizes based just on the dimensions you have given it and not try to work out how big to make things based on the content. This will mean that things like your 1% width on the date column is likely to truncate that column (except on the very very widest of screens).

    I’m not sure there is an easy way to turn off wrapping while doing the overflow and keeping nice resizing. I think fixed layout tables may be your only option.

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

Sidebar

Related Questions

I have a table with a few relational columns and one XML column which
I have two table, one is ItemData(ItemID, ItemName) and other one has few columns.
I have a table with few columns and one of the column is DockNumber.
I have a table which consists of a few columns, including a Key Value
I have a table, tblDocs that has a few columns: DocName varchar(50) DocLocation int
I have a table with a few thousand rows. The table contains two columns,
I have a query in VBA that Adds a few columns to a table.
I have a table of data which is generated dynamically with Javascript. Every few
I have a table called sales with the following few columns: salesno (PK, char(25))
We have a few tables with persisted computed columns in SQL Server. Is there

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.