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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:39:17+00:00 2026-05-26T22:39:17+00:00

In another question, I have a solution for showing or hiding a div based

  • 0

In another question, I have a solution for showing or hiding a div based on the page width.

Displaying elements on my page depending on the page width

Now, I would like a more advanced technic where we show or hide columns in a table based on the page width.

Here is an example of table:

<table>
    <tr>
        <td id="col1">aaa aaaa</td>
        <td id="col2">bbbb bbb</td>
        <td id="col3">ccccc</td>
        <td id="col4">ddd dddd ddd ddd</td>
    </tr>
</table>

Let’s say:

  • I would like to display col1 only if page width is greater that 800px.
  • I would like to display col2 only if page width is greater that 830px.
  • I would like to display col3 only if page width is greater that 860px.
  • I would like to display col4 only if page width is greater that 900px.

It has to be dynamic so if the user resize the window, the content has to be shown/hidden.

Do you see what I would like to achieve? Is there a better way of doing this?

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-05-26T22:39:17+00:00Added an answer on May 26, 2026 at 10:39 pm
    @media screen and (max-width: 800px) { 
        #coll1 {
            display:none;
        }
    }
    
    @media screen and (max-width: 830px) { 
        #coll2 {
            display:none;
        }
    }
    

    … and so forth, should probably do it.

    Edit:
    Note the limited browser support for media queries in older browsers.

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

Sidebar

Related Questions

This is a followup/post question to another question; as I have discovered a solution
Per a great answer from another question I have begun mounting global resources (css/js/images)
This question is kind of related to another question but I have a specific
Okay, so I have another question on a prolog homework problem I am struggling
Another basic Rails question: I have a database table that needs to contain references
Another question related to this one . I have a List<SortableObjects> that is the
I have recently posted another question which straight away users pointed me in the
As described in another question , I have a set of Model objects and
This question is related to another question I asked Basically, I have 2 horizontally
this kind of follows on from another question of mine. Basically, once I have

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.