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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:23:15+00:00 2026-05-30T08:23:15+00:00

I have a table with two columns. The width of the 2 columns are

  • 0

I have a table with two columns. The width of the 2 columns are set and should not be modified. The first column contains 2 spans standing side by side. The content of the first span has a variable length. The second span also. What I would like to do is to hide the overflow of the second span when the content hits the border. I tried several things but I do not manage to find a solution. Hope someone can help. Thank you in advance for your replies. Cheers. Marc.

http://cssdesk.com/eAN3d

My HTML:

<table>
  <tr>
    <th>th1</th>
    <th>th2</th>
  </tr>
  <tr>
    <td>
      <span>Paul</span>
      <span class="hide-overflow">Some text with no overflow</span>
    </td>
    <td>txt</td>
  </tr>
  <tr>
    <td>
      <span>Emmanuelle</span>
      <span class="hide-overflow">The overflow of this text string has to be hidden.The td has to be only one line and the width should not be extended.</span>
    </td>
    <td>txt</td>
  </tr>
</table>

My CSS:

table{
  width:400px;
  border-spacing: 0px;
  border-collapse: collapse;}

th,td{
  border:1px solid black;}

td:first-child{
  width:350px;}

td:last-child{
  width:50px;}

.hide-overflow{
  background-color:yellow;
  }
  • 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-30T08:23:16+00:00Added an answer on May 30, 2026 at 8:23 am

    I’m not incredibly happy with this, but it does seem to work in Firefox. jsFiddle

    table{
      width:400px;
      border-spacing: 0px;
      border-collapse: collapse;
      table-layout:fixed;
    }
    
    th,td {
      border:1px solid black;
      white-space: nowrap;
    }
    
    th:first-child, td:first-child{
      width:350px;
      overflow:hidden;
    }
    
    th:last-child, td:last-child{
      width:50px;
    }
    
    .hide-overflow{
      background-color:yellow;
    }
    
    span.hide-overflow {
      white-space:nowrap;
    }
    

    This is the result:

    Example

    • 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 two columns and one row, and 100% width across
I have a table with two columns: column A column B 1 2 1
Say I have an MSSQL table with two columns: an int ID column that's
I have two tables with similar columns - let's say table A with column
I have a table with two columns, GroupId and ParentId (both are GUIDS). The
Suppose I have a tags table with two columns: tagid and contentid . Each
I have a very simple table with two columns, but has 4.5M rows. CREATE
I have two tables in my database: NEWS table with columns: id - the
I have a MySQL database table with two columns that interest me. Individually they
What I have are two tables: mark_notifications mark_notifications_options The mark_notifications table contains rows of

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.