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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:06:34+00:00 2026-06-12T10:06:34+00:00

I have a CSS table which is reused throughout my code. The size of

  • 0

I have a CSS table which is reused throughout my code. The size of the data, and the number of columns for the table varies every time the table is used.
The max width (set by CSS) for the table is 80% of page. However, Sometimes when the table has a little data (maybe extending table to 50% of the page) some lines of text will separate into two lines. How to I counteract this, so the table uses all the space available to it.

This is what happens at the moment:

Problem

I’ve tried setting the manual width for the table, but that means the table remains stretched even when the table width only needs to be small.

I’ve also tried using CSS white-space:nowrap; However this cause the table to extend beyond 80% if there is a lot of data in one column.

Anyway to solve these two problems with CSS?

  • 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-12T10:06:35+00:00Added an answer on June 12, 2026 at 10:06 am

    Just use this css:

    td
    {
    white-space: nowrap; overflow: hidden; text-overflow:ellipsis;
    }​
    

    And the result is like this: http://jsfiddle.net/ongisnade/pghny/

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

Sidebar

Related Questions

I have a table which has columns of data that contain status. Two example
I have a table of data which is generated dynamically with Javascript. Every few
I have a three rows CSS table, which is nested in a fixed size
I have a table which has many columns and lots of records. My user
I have a table which is created dynamically. Sometimes it can have two columns
I have this code for a table which is very simple: <table cellspacing=10 cellpadding=10>
I have one table which display data as from Dynamic Content, I want to
I have one table which display data as from Dynamic Content in 1 column.
I have an HTML table which is styled using CSS. The table is composed
I have a table which has a certain style due to the CSS file

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.