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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:25:59+00:00 2026-06-14T22:25:59+00:00

Synopsis: I need to display a table like the one below: Necessities: Semantic HTML

  • 0

Synopsis: I need to display a table like the one below:

table with different spacing between head and body

Necessities:

  • Semantic HTML coding
  • No scripting

HTML:

<table>
<thead>
    <tr>
        <th colspan=2>
            One
        </th>
        <th colspan=2>
            Two
        </th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>
            One
        </td>
        <td>
            Two
        </td>
        <td>
            Three
        </td>
        <td>
            Four
        </td>
    </tr>
    <tr>
        <td>
            One
        </td>
        <td>
            Two
        </td>
        <td>
            Three
        </td>
        <td>
            Four
        </td>
    </tr>
<tbody>
</table>

First attempt:

“border-collapse attribute”

I tried border-collapse: separate; on thead and border-collapse: collapse; on tbody but that simply didn’t work.

table {
    border-collapse: collapse;
    border-spacing: 1em;
}

table thead {
    border-collapse: separate;
}

table tbody tr {
    border-bottom: 1px solid black;
}

table thead tr th{
    border-bottom: 1px solid black;
    padding: 10px;
    text-align: center;
}

table tbody tr td {
    border-bottom: 1px solid black;
    padding: 10px;
}​

On JSFIDDLE


Second Attempt:

“Adding blank cells”

I can get the preferred look of the table by adding blank cells in HTML code. But this approach defects semantic structure.

table {
    border-collapse: collapse;
    border-spacing: 1em;
}

table tbody tr {
    border-bottom: 1px solid black;
}

table thead tr th[colspan="2"]{
    border-bottom: 1px solid black;
    padding: 10px;
    text-align: center;
}

table tbody tr td {
    border-bottom: 1px solid black;
    padding: 10px;
}​

On JSFIDDLE


Other various attemps

I also tried -webkit-border-image: -webkit-linear-gradient(left, black 95%, white 5%); on headers borders but couldn’t manage to get it working.


After all I am open to new suggestions.

Note:
This is going to be in an eBook file. So general background color may vary in different reader applications.

  • 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-14T22:26:01+00:00Added an answer on June 14, 2026 at 10:26 pm

    Depending on your compatibility requirements, you have the option of using CSS generated-content:

    th {
        /* other CSS */
        position: relative;
    }
    
    thead th::before,
    thead th::after {
        content: '';
        position: absolute;
        bottom: -1px;
        width: 0.5em;
        border-bottom: 1px solid #fff;
    }
    
    thead th::before {
        left: 0;
    }
    
    thead th::after {
        right: 0;
    }
    

    JS Fiddle demo.

    For the sake of simplicity I’ve given both th elements the same ::before and ::after, however if there’s always only two th elements the selectors can be changed:

    th {
        /* other CSS */
        position: relative;
    }
    
    thead th:first-child::after,
    thead th:last-child::before {
        content: '';
        position: absolute;
        bottom: -1px;
        width: 0.5em;
        border-bottom: 1px solid #fff;
    }
    
    thead th:last-child::before {
        left: 0;
    }
    
    thead th:first-child::after {
        right: 0;
    }
    

    JS Fiddle demo.

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

Sidebar

Related Questions

I display some content in my view using this: <%= Html.Encode(Model.synopsis) %> The content
Synopsis: I have a need to take two generic C# objects, and if they
I have two @Html.ActionLink's one works and one does not and I cannot figure
Synopsis: Each User account has a UserProfile to hold extended info like phone numbers,
I would like to translate the following Unix 1 Liner to PowerShell. Synopsis of
Here is my code thus far: $(document).ready(function(){ $(.KD).click(function(){ $(p).load('KD.html'); $(.video).load('KDVideo.html'); $(.synopsis-change).toggleClass(synopsis); $(.synopsis).toggleClass(synopsis-change); }); });
The SYNOPSIS for Test::DBIx::Class states: Yes, it looks like a lot of boilerplate, but
I am new to Unix shell scripting and would like some help with writing
Synopsis I would like to harness Boost Spirit's stream parser API to parse an
I have a mysql statement like this: mysql_query(INSERT INTO movies (comments, description, synopsis) VALUES

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.