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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:13:54+00:00 2026-06-14T23:13:54+00:00

I have noticed a problem with size of elements in Chrome browser. I have

  • 0

I have noticed a problem with size of elements in Chrome browser.
I have written a simple code:

<html>
<body>
<table border="1px">
<tbody>
<tr>
    <td>
        <span style="display: inline-block; width: 5cm">TEXT</span>
        <span style="display: inline-block; width: 5cm">TEXT</span>
        <span style="display: inline-block; width: 5cm">TEXT</span>
        <span style="display: inline-block; width: 5cm">TEXT</span>
    </td>
</tr>
</tbody>
</table>
</body>
</html>

I expect to have 4 spans repeated vertically, 5cm each. It works on IE, Firefox, etc.:
IE – Works fine

But Chrome suffers the following problem:
Chrome – Doesn’t work

In IE, spans have 189px width each and td has 772px.
In Chrome, spans have 189px width each and td has 771px.

Is this some kind of Chrome issue? Why my td element doesn’t fit its content? It’s important for me to stay with those span elements (I cannot replace them with i.e. div) and to set width in cm. The issue still exists when I remove table border.

  • 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-14T23:13:55+00:00Added an answer on June 14, 2026 at 11:13 pm

    CSS cm units are unreliable if you want a fixed number of pixels. They’re also not likely to actually measure 5cm on the screen. The cm unit is intended mainly for printing styles. Yes, it can be used on screen, but don’t expect any accuracy from it.

    The fact that a 5cm box is rendered as 189 pixels tells us that a cm is not a whole number of pixels. This alone should be enough to tell you that you’re unlikely to get accurate pixel-level cross-browser rendering using cm units.

    It’s just not going to happen. If you want pixel-perfect accuracy, use px units.

    You say in the question that you can’t change the units. You really should reconsider that if possible, because it’s only going to keep giving you these issues.

    If you really can’t change them, then the one way I can think of to resolve your issue without changing the units is to give the <td> element a white-space:nowrap style. This should force all the spans onto the same line regardless of whether the browser thinks they should be there or not. It should do the trick for you. But it doesn’t resolve the underlying problem, and it will likely come back in other ways if you keep using cm units on the screen.

    As for what exactly is causing the glitch in the first place, I would guess that Chrome is handling the floating point pixel values slightly differently, and that there is a rounding error when it adds the pixel widths of the spans to work out how wide to make the <td>. If this is the case, then it sounds like a bug in Chrome, and you could report it to them, but given everything I’ve said above, I can’t see them making it a high priority issue.

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

Sidebar

Related Questions

While debugging a problem in a WPF application, I have noticed that the TwoWay
I have noticed FF, Chrome and Safari behaving such that if you intervene to
I have a table with variable-width cells, and I want to give the browser
I have two problem, This nestedSortable is not working in this code, where's the
I noticed a problem on Android's default browser, where 100% width may actually go
I am developing a SDL OpenGL application on Ubuntu and have noticed a problem
I have narrowed down the problem to this line: indg = nets[i]->adjlist[i].size(); // indg
I have noticed a difference in behaviour between chrome and IE of handling file
After migrating from Grails 1.3.7 to 2.0.4 I have noticed a problem with one
I have successfully debugged my own memory leak problems. However, I have noticed some

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.