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 8 of 8
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Tables in HTML5?

    Have been trying to construct a football league table which has 3 columns. Would really appreciate any of the forum experts criticisms and/or advice.

    The webpage itself can be viewed here!

    Thanks all

  • #2
    Regular Coder
    Join Date
    Dec 2011
    Posts
    201
    Thanks
    12
    Thanked 26 Times in 26 Posts
    looks like you figured it out?

    html5 tables are just like previous html versions.

  • Users who have thanked SeattleMicah for this post:

    Frump (06-05-2012)

  • #3
    New Coder
    Join Date
    Sep 2010
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks for the reply SeattleMicah

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    Well, actually, the table is semantically incorrect. But it has nothing to do with HTML 4 or 5, it’s semantically incorrect in both versions. There is an extensive article (from 2002 but still valid today) on how to create a proper and accessible irregular table (such as yours is an irregular table).

    For one, nesting tables is bad practice. You should rather use column groups (<colgroup>) to group columns and for the table “title”, or rather caption, you should use the <caption> element. Also, the border and align attributes are long deprecated and shouldn’t be used. That’s what CSS is there for.

  • The Following 2 Users Say Thank You to VIPStephan For This Useful Post:

    Frump (06-09-2012), SeattleMicah (06-06-2012)

  • #5
    Regular Coder
    Join Date
    Dec 2011
    Posts
    201
    Thanks
    12
    Thanked 26 Times in 26 Posts
    sorry frump didnt look at your code! ya don't nest tables!!!! haha

  • #6
    New Coder
    Join Date
    Sep 2010
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Shall start learning all about (<colgroup>) to group columns. Thanks VIPStephen

  • #7
    New Coder
    Join Date
    Sep 2010
    Posts
    62
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Have been looking around and came up with my latest effort. Would someone have a look at the CSS for me please.

    Also, i can't figure out how to make a new css rule which would make each individual team align to the left and add a little padding.

    You can view my latest effort HERE

  • #8
    Regular Coder
    Join Date
    Dec 2011
    Posts
    201
    Thanks
    12
    Thanked 26 Times in 26 Posts
    hey good looking table.

    You can place a class on all of the <td> with the names.

    Code:
    <td class="teamName">Birmingham</td>
    Then add some css for that class to the align the text for the names left, and add some padding.

    Code:
    .teamName {text-align:left; padding: 20px 20px 20px 20px;}


  •  

    Posting Permissions

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