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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:22:35+00:00 2026-05-22T22:22:35+00:00

Ok, here is one for you. I want to have a table with 4

  • 0

Ok, here is one for you. I want to have a table with 4 columns total. I only want to view 3 of these columns even when resizing my browser leaving the 4th column always hidden from view. However, I still need to keep my scrollbar so I can scroll to the 4th column if necessary. Essentially 3 columns take 100% of viewport.

I want to use jQuery for this without any plugins.

  • 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-22T22:22:36+00:00Added an answer on May 22, 2026 at 10:22 pm

    Ok folks. Here’s how you do it, create a function that you can call onResize in the body tag. Create a table with a header row that colspans over 3 of the columns that will be unused, make it nowrap (important). Get the size of the total width viewport and set the first td width to that, it was actually easier than I thought:

    <html>
    <head>
    <script src="jquery.min.js"></script> 
    <script type="text/javascript">
    function doColWidths(){
        $("td:first").css("width",$(window).width());
    }
    </script> 
    </head>
    <body onresize="doColWidths()">
        <table>
            <tr>
                <td colspan="3" nowrap="nowrap"></td><td></td>
            </tr>
            <tr>
                <td id="col1">Col1</td>
                <td id="col2">Col2</td>
                <td id="col3">Col3</td>
                <td id="col4">Col4</td>
            </tr>
        </table>
    </body>
    </html>
    

    I hope this helps someone out in the future.

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

Sidebar

Related Questions

Here's my problem: I have a table with 4 columns (type = array, one-dimension)
I have a table of one row with two columns.I want to align content
Here i want to do UDP Socket programming in C. I have one device
Here is my code, I have two checkboxes and want to keep one disabled
Ok, so here's what I want to do, preferably with jQuery 1.4.2: Have one
Play with it here: http://jsbin.com/ocicu4/4/edit Simple Accordion, I only want one section open at
I want to select only one radio button but I cant do this. Here
I want to create a view in a one-to-many relation. Here are my relations:
I have a table with two columns where I need one ( columnB )
I have multiple columns in a table One column may contain the name of

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.