SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    using table or div

    i need to add data in a table format ie column & row , instaed of using<table></table> can it be done using div as using table may not be displayed properly in all browsers

    i have 7 columns & 15 rows

    or a div in a <td> wuld be good

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,467
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    If its tabular data it should go in a table and there should be no problem with it displaying unless you are doing something weird to it.

  3. #3
    SitePoint Enthusiast Baylisstic's Avatar
    Join Date
    Jul 2010
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm with Paul here, it should go in a table if it is tabular data and there certainly shouldnt be any display problems.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,182
    Mentioned
    16 Post(s)
    Tagged
    4 Thread(s)
    Sounds like a list of content such as a grid of products. In that case a list would be the way to go alongside CSS to accomplish the desired design goals.
    The only code I hate more than my own is everyone else's.

  5. #5
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,480
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Table should display fine as long as you code right.

    Many prefer using div over table mainly because of the loading nature on the browser. Table isnt rendered on the page until the entire content is cached, whereas using divs allow the browser to render piece by piece.

    Some people find it easier to code with table then div of course.

  6. #6
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webcosmo View Post
    Some people find it easier to code with table then div of course.
    If you're talking about tabular structures for an entire site, that's long outdated and never, ever recommended as good practice.

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,861
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    In most instances neither a table nor a div is the appropriate tag to use.

    What you need to ask yourself is what the most appropriate tag is to match with what the content actually is. When the content is tabular data to be set out in a tabular format is the only time that a table is the right choice. The only time a div is the right choice is when there is no othet HTML tag that describes what the content is.

    With what the OP is asking about tha right tag to use would either be a table - if it genuinely is 15 records each having the same zeven fields that you want to display - or if it isn't tabular data then the most likely possibility is that it is a list.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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