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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:53:04+00:00 2026-06-14T08:53:04+00:00

Check out this fiddle: http://jsfiddle.net/foreyez/hQ9ZR/ <table background=’red’> <thead> <tr> <th style=’width:3000px;background:red’>Students</th> </tr> </thead> <tbody>

  • 0

Check out this fiddle:
http://jsfiddle.net/foreyez/hQ9ZR/

<table background='red'>
<thead>
    <tr>
        <th style='width:3000px;background:red'>Students</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>Joe</td>
    </tr>
    <tr>
        <td>Shmoe</td>
    </tr>
</tbody>

​

and the css is:

  html,body { overflow:auto; }

When I make the width of the Header 3000px I’d expect it to cause an overflow (scrollbar) in the page. But it doesn’t. It’s because the width of the header cell doesn’t change the overall table’s width.

If you set the width of the table to 3000px, you’ll see the overflow (scrollbar)

So basically, I’m wondering if there’s a way to make it so the table’s width is defined by it’s headers widths?

Thanks

  • 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-14T08:53:06+00:00Added an answer on June 14, 2026 at 8:53 am

    First of all this is not the way you style tables these days

    <table background='red'>
    

    use this instead

    <table style="background:red;">
    

    And secondly you need to use min-width for th instead of width

    My Fiddle

    <th style='border: 1px solid #fffff0;min-width:5000px;background:red'>Students</th>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

check out this fiddle: http://jsfiddle.net/5rmEe/61/ var inputVal = false; //allow user to deselect a
check out this fiddle: http://jsfiddle.net/5rmEe/ the goal is to uncheck the radio button when
Check out this fiddle: http://jsfiddle.net/mattball/nWWSa/ var $lis = $('ul.innerfade > li'); function fadeThemOut() {
Check out this fiddle: http://jsfiddle.net/sajYc/ The transition for the :after pseudo element works in
Please check out this fiddle: http://jsfiddle.net/dppJw/8/ I've used a pseudo-element for the body (also
If you check out this JS fiddle: http://jsfiddle.net/DE5Bp and try to sort the Tariff
http://jsfiddle.net/4UbKe/3/ Please check out the fiddle to see exactly why it doesn't work. I'm
In this fiddle http://jsfiddle.net/SySRb/105/ , function init(); successfully checks for the existence of an
Please have a look at this fiddle: http://jsfiddle.net/mrmartineau/53fkV/embedded/result/ The intended outcome is that when
I used this script to create a jQuery accordion. Check out the working jsFiddle

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.