Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: html tables

  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    158
    Thanks
    71
    Thanked 1 Time in 1 Post

    html tables

    Hey, I have a general question which I am trying to find the answer too. On my site, I have a 2 column table which is used to display data. My site is responsive, and when viewed on a mobile, I want the 2 column table to become a single column table. Is this possible?

    Cheers

    Nick

  • #2
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by nick2price View Post
    Hey, I have a general question which I am trying to find the answer too. On my site, I have a 2 column table which is used to display data. My site is responsive, and when viewed on a mobile, I want the 2 column table to become a single column table. Is this possible?

    Cheers

    Nick
    It may be possible with PHP or perhaps even with JavaScript. The </tr><tr> that creates the second column can be omitted when the page is viewed with a mobile device.

    Will
    Last edited by Will Bontrager; 07-19-2012 at 11:33 PM. Reason: codes didn't print correctly
    Numerology API for apps - Facebook, iPad, mobile phones. No charge to use API. [info]

  • #3
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    making entire website, content and all scale to width of monitor

    If a website is a mobile device, then load a stylesheet in which hides the second column. Quite simply, a stylesheet (which I would name "mobile.css"), would have:

    Code:
    .column2 {
        display: none;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •