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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:30:19+00:00 2026-06-07T06:30:19+00:00

So I am styling a table, and I’d like to make quite a fancy

  • 0

So I am styling a table, and I’d like to make quite a fancy underline for the table headings.

I’ve though hard and had a look on the internet but couldn’t find anything.

This is the table structure:

<table>
    <thead>
        <tr>
            <td>Number</td>
            <td>Name</td>
            <td>Address</td>
        </tr>
    </thead>

    <tbody></tbody>
</table>

And my current styling:

table {
    width: 100%;
}

    table thead {
        font-weight: bold;
    }

        table thead td {
            margin-right: 5px;
            border-collapse: separate;
            border-spacing: 10px 5px;
            border-bottom: 2px solid #427AA8;
        }

    table tbody {
        font-size: 90%;
    }

        table tbody tr {
            line-height: 2em;
            border-bottom: 1px solid #CCC;
        }

        table tbody td {
            padding: 0 5px;
        }

Here is a jsfiddle of the code: http://jsfiddle.net/tYA4e/1/

What I am looking for is a break in the border between the columns, but only in the thead.

And an example of what I am trying to achieve: http://i.imgur.com/OHrhJ.jpg

Is there a way to achieve this with some simple 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-07T06:30:22+00:00Added an answer on June 7, 2026 at 6:30 am

    A border will, necessarily, extend the full width of its element; therefore to extend a border only partially across the width of an element that border must be applied to a child element, sized accordingly.

    That said, the only way this is achievable would seem to be with nesting an element within the td (in this case a span), and using the following CSS:

    table thead td span {
        display: inline-block;
        width: 80%;
        border-bottom: 2px solid #427AA8;
    }
    

    JS Fiddle demo.

    As an aside, though, it’s worth noting that, for table-headings, the th (table-heading) element might be more appropriate for your use in this case.

    On further thought it is, of course, also possible to use styled hr elements, which allows you to give pixel-level control over the hr‘s width in that it can extend up to, in this example, 10px from the right edge of the parent td):

    table thead td hr {
        width: 80%;
        margin: 0 10px 0 0;
        border-bottom: 2px solid #427AA8;
    }
    

    JS Fiddle demo.

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

Sidebar

Related Questions

I would like to override following CSS styling defined for all tables: table {
I created a table without borders styling and I want it to underline a
I am trying to style the following table but I can't avoid styling every
I have a table with some styling. It's like: <table class=table_design id=cart> <tr> <td>something</td>
I'm struggling to apply css-styling to a GWT (Google Web Toolkit) generated html table
I am styling the messages in red for errors and green for success. But
I use some CSS styling to hide input buttton, images and so on but
I'm trying to select the first h2 in this table (which is called 'styling')
I'm trying to create an HTML/CSS-based week calendar using CSS display:table-cell styling on the
I'm having a problem while trying to dynamically change a table cell's styling class

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.