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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:46:22+00:00 2026-06-10T15:46:22+00:00

I am trying to recreate a table element using inline blocks of fixed width,

  • 0

I am trying to recreate a table element using inline blocks of fixed width, and I am suffering an apparently inconsistent behavior from the browsers (Chrome and IE) in spacing elements.

Here is an image of the problem:

enter image description here

the problem is that the first in the top two rows (which should act as headers and are part of the static HTML of the page) the span get a strange spacing on the right – as you can read below from the CSS there is a margin of 0 declared (this is obviously a WIP, some span should just be replaced by divs etc. so pls bear with me.).

If I instead add dynamically the rows at run time through Javascript, I get the two rows below – which is the expected behavior. In blue you can find the container of these rows – 100% of the div element including all of this.
Ther reason I am using this approach instead of a normal table is that I want to have the dynamic data rows scrollable, which is not achieveable in a neat way with a table.

Here is the HTML:

 <span class="cssTRC">
            <span>
                <span>Day</span>
                <span>Loc</span>
                <span>Nagare</span>
                <span>Pcs</span>
                <span>Packs</span>
            </span>
            <span>
                <span>Thu 30 Aug</span>
                <span>E5-1</span>
                <span>{only DI}</span>
                <span>480</span>
                <span>1</span>
            </span>
    </span>
   <span id="ctblrcOrdHist" class="cssTRC">
         <span>
              <span>Thu 30 Aug</span>
              <span>E5-1</span>
              <span>DI</span>
              <span>480</span>
              <span>1</span>
         </span> 
         <span>
            <span>Thu 30 Aug</span>
            <span>KE-1</span>
            <span>DI</span>
            <span>500</span> 
            <span>1</span>
         </span>
      </span>

and the CSS, defined as follows:

.cssTH>span>span,.cssTRC>span>span
{
    display:inline-block;
    text-overflow:ellipsis;
    white-space:nowrap;
    overflow:hidden;
    font-size:1em;
    box-sizing:border-box;
    width:5em;
    padding:0.2em;
    margin:0;
    border:0 solid red/*#E8EEF4;*/;
    border-width:0 0 1px 1px;
}
.cssTH>span, .cssTRC>span
{
    display:block;
}
.cssTRC
{
    border:0 solid #E8EEF4;
    border-width:1px 1px 0 0 ;
    display:block;
    /*max-height:200px;
    overflow-y:auto;*/
    box-sizing:content-box;
} 

The question is obviously how I can get the expected behavior for the first two rows without adding the pseudo-header at run time (which sounds horrible).

EDIT

I write down the solution I consider more handy so that this can work also as a small example of basic CSS table layout, in case someone might need it:

            <div>
                 <span>Day</span
                ><span>Loc</span
                ><span>Nagare</span
                ><span>Pcs</span
                ><span>Packs</span>
            </div> 
  • 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-10T15:46:23+00:00Added an answer on June 10, 2026 at 3:46 pm

    The problem cause by whitespace between your spans – DEMO

    I’ve used the float fix in this example. For more ways of fixing this issue you can take a look here

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

Sidebar

Related Questions

Hey I am trying to recreate the following HTML <table border=0 cellspacing=0 cellpadding=2 width=100%
I am trying to recreate this table in my rails 3 app. I believe
I am trying to recreate the program in Column 15 of programming pearls using
I've been trying to recreate an effect from this tutorial: http://jqueryfordesigners.com/jquery-look-tim-van-damme/ Unfortunately, I want
I'm currently learning Python using Zelle's Introductory text, and I'm trying to recreate one
I'm trying to recreate a sort of table layout of a contact form. Here's
I'm trying to recreate this UISearchBar (as seen in the Table Search example code):
I'm trying to migrate my app from MySql to Postgresql, using Rails3-pre and the
THere is a oracle query that I am trying to recreate using OpenJPA. I
I have a Crystal Report I'm trying to recreate from scratch after an update

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.