Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Help with Media Queries for Table Columns

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #297524
    VancouverMel
    Participant

    Hi,

    I’m new at coding and I could use a little help please. :)

    I’ve got a table in which I’ve organized 13 services offered by a company. Each service is in its own cell. In my html file (using td and tr tags), I’ve organized them in 3 columns and 5 rows.

    The order of the services isn’t important. All I want is the number of columns to change with browser window size. I’ve put in media queries and the number of columns changes where I want it to, but the problem is that, instead of reorganizing the content in the column that’s cut, that content just disappears. So basically, it’s showing either just the first column of my table, or just the first two… instead of reorganizing the whole table content into two columns and one column (as I’d like to have it).

    Hope that makes sense? You can see it here (all 13 services should always all show but in more or less columns):

    http://runmelanierun.com/g/services.html

    The media queries I’ve put in are (I’ve cut and pasted them from a website – I don’t fully understand them):

    @media screen and (max-width: 1100px) {
    table td:nth-of-type(4) {
    display: none;
    }
    }

    @media screen and (max-width: 950px) {
    table td:nth-of-type(3) {
    display: none;
    }
    }

    @media screen and (max-width: 800px) {
    table td:nth-of-type(2) {
    display: none;
    }
    }

    How can I adjust things so that no content is lost?

    I appreciate any help! I’ve spent hours on this with no success….

    Melanie

    #297525
    Paulie_D
    Member

    You can’t change HMTL table structure with CSS (media queries).

    I’d suggest you rethink your approach.

    #297542
    VancouverMel
    Participant

    Darn..! Thanks. I’ll try a card layout then.

    I appreciate the help!! :)

    Melanie

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.