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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:32:10+00:00 2026-05-20T03:32:10+00:00

I have a table containing data which I do not want to wrap onto

  • 0

I have a table containing data which I do not want to wrap onto more than one line, so this is the CSS applied to the cells:

td {
    white-space: nowrap;
    overflow: hidden;
}

This works fine and dandy, however, I’d like to show the users a tooltip containing the full content of that cell, but only if some overflowing text is being hidden. Therefore, I need a programmatic way to tell if the cropping/truncation is occurring.

In Safari and Chrome, I can inspect the element.scrollWidth property, and if it is larger than element.clientWidth then it is being cropped. However, no matter how much text is in the cells, Firefox always reports these two to be the same (give or take a couple of pixels for the border/padding/margin).

I’ve put an example together on JSBin so you can see for yourself. Try resizing your window and look at the output.

http://jsbin.com/equbo3/4

ps: For me, the solution doesn’t need to work in IE, but if you know of a way for it too, please do share.

  • 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-20T03:32:11+00:00Added an answer on May 20, 2026 at 3:32 am

    The problem seems to be with how FF interprets table cells.
    If you change the overflow value to ‘auto’ or ‘scroll’ it displays as if it were ‘overflow:visible’ which won’t return an appropriate scrollWidth. This doesn’t happen in Chrome.

    If you change the display type to ‘display:block’ you get the correct scroll bar and scroll width returned, but obviously you lose the tabular layout.

    Potentially you could wrap the contents of the cells in another tag with the following styles:

    newTag {
    display:block; /*just in case it is not default*/
    overflow:scroll;
    }
    

    as I have here.

    This could be done in the markup or dynamically as you do your calculations.

    It is not a great solution I know – but I don’t know of any display settings to get around this (cycled through options using firebug).

    Hope this helps in some way

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

Sidebar

Related Questions

I have 2 databases, and I want to transport an existing table containing a
I have a table containing prices for a lot of different things in a
I have a table containing the runtimes for generators on different sites, and I
I have a table containing hundreds of entries and I am trying to delete
I have a table containing cells with text of various lengths. It is essential
I have a MySQL table containing domain names: +----+---------------+ | id | domain |
I have the following table containing the winning numbers of 6/49 lottery. +-----+------------+----+----+----+----+----+----+-------+ |
Say I have at database table containing information about a news article in each
We have a SQL Server table containing Company Name, Address, and Contact name (among
I have an aspx page with 1 table containing 2 rows: <!DOCTYPE html PUBLIC

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.