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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:33:54+00:00 2026-05-15T04:33:54+00:00

I have a table, with many tds. I want to display a div behind

  • 0

I have a table, with many tds. I want to display a div behind this to give the appearance of it having rounded corners. I have called the Div within a th. Here is a jsFiddle example of the problem.

I thought I could do it using position: realtive; and z-index: -100; yet it doesn’t seem to be what I want.

Thanks to anyone for any help.

  • 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-15T04:33:55+00:00Added an answer on May 15, 2026 at 4:33 am

    I think you’ll need a different approach. For the <div> to be the same height as the <table>, you’ll need the <div> to wrap the table:

    <div>
        <table>
        ....
        </table>
    </div>
    

    That’ll also make the <div> appear “behind” the <table> without fiddling with z-index.

    From your jsFiddle example, I think you only want the background behind one table column? To achieve this, you’ll need to:

    • fix the width of all the columns in your <table>
    • set the width of the <div> to the width of the column you want it to be the background for (or a little wider)
    • set the left margin of the <div> to the width of the other columns in the <table>
    • set the left margin of the <table> to minus the width of the other columns in the table.

    Maybe something like this?

    <div class="compare-rounder">
        <table>
            <thead>
                <th class="price">Price</th>
                <th class="product">Product</th>
            </thead>
            <tbody>
                <tr>
                    <td>$4000</td>
                    <td>for this</td>
                </tr>
            </tbody>
        </table>
    </div>
    
    table,
    table td,
    table th
    {
        border: 1px #000 solid;
    }
    
    table
    {
        margin-left: -500px;
    }
    
    .product
    {
        width: 500px;
    }
    
    .price
    {
        width: 50px;
    }
    
    .compare-rounder
    {
        width: 60px;
        background-color: #f0f; /*bright pink*/
        border: 1px #ccc solid !important;
        border-radius:5px;
        -moz-border-radius:5px;
        -webkit-border-radius:5px;
        margin-left: 500px;
    }
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in the db called task. This table has many other
I have a table with many rows of data, and I want to show
I have a table with many anniversaries : Date + Name. I want to
In each table have many number of rows with amount. Like this i have
i have a table which has many fields but i want to get count
I have a data table with many rows and columns. How can I display
I have a div with many many html elements like other divs, trs, tds,
I have many table cells which I want to show a tooltip once hovered.
I have a table similar to this, but with many rows: <table width=400px id=mytable>
I have a table with many rows. I want to have an on hover

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.