treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Table, list or other?

  • Hey guys, how would you mark up the content that's shown in the image?

    http://i40.tinypic.com/28isp74.jpg

    At the moment it's marked up as a table.

    I ask myself this. What does the data represent? It's a list of events showing the date and a link to the event. So therefore a list would be best?

    For example I would probably mark it up as the following:

    <ul>
    <li><span class=\"date\">05-02</span>event name <a class=\"event-link\" href=\"http://www.etc.com\">view</a></li>
    </ul>


    How would you mark-up the column headers though? This is why I'm thinking of leaving it marked up as a table?

    I'd like to get your input guys!
  • I don't think I'd mind leaving that as a table. You could use divs, but I just don't see the point.
  • Agreed. That says table all over it.

    "acialk" said:

    I ask myself this. What does the data represent? It's a list of events showing the date and a link to the event. So therefore a list would be best?


    That isn't a list

    A list would be like a column of information:

    bob
    john
    ralph
    etc.

    When you add another dimension to it (like columns+rows), you get a table. A table, although a little clunky, is perfect for organizing columns and rows of information.
  • Thanks guys.

    I took a look at the specs

    "The HTML table model allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other tables, etc. -- into rows and columns of cells."

    I don't know what I was thinking earlier but it makes sense now. :roll: