Thread: Table HTML

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    46
    Rep Power
    2

    Table HTML


    Hi all,

    In my table here 'Match Schedule' is meant to be the title of the table - so far the title is just in one column - can anyone please tell me how I can center the title across the whole row instead of being just in one column, and start the columns on the second row rather than the first (= title) row?

    Thank you...
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,127
    Rep Power
    4304
    Interesting. You're using <th> elements, where appropriate, but you don't know the answer to that. I guess you're one of the fortunate people who has never had to (mis)use tables for layout.

    What you need is the "colspan" attribute. I recommend that you add the "scope" attribute to your <th> elements as well.
    http://dev.opera.com/articles/view/c...e-data-tables/
    http://icant.co.uk/forreview/tables/
    http://www.htmldog.com/guides/html/intermediate/tables/
    http://learn.shayhowe.com/html-css/o...ng-data-tables

    Comments on this post

    • Winters agrees : Table abuse. The forbidden pleasure.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    46
    Rep Power
    2
    Originally Posted by Kravvitz
    Interesting. You're using <th> elements, where appropriate, but you don't know the answer to that. I guess you're one of the fortunate people who has never had to (mis)use tables for layout.
    Correct

    Thanks...
  6. #4
  7. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    3
    Rep Power
    0
    use <th> html tags to specify the header for your table.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    17
    Rep Power
    0

    HTML Table


    Hey Dear,

    Use easily link and try all HTML table.

    http://www.w3.org/TR/html401/struct/tables.html

    Good Luck.***
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    14
    Rep Power
    0

    Thumbs up


    hi dude

    I hope that this site will be helpful to you

    httpCOLON//www-cdrDOTstanfordDOTedu/~petrie/jump5DOThtm
  12. #7
  13. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    23
    Rep Power
    0
    align the td center
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    6
    Rep Power
    0
    You can also use div instead of table
    jsfiddle[dot]net/aJPHa/2/
  16. #9
  17. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,127
    Rep Power
    4304
    Originally Posted by JackSmith012
    You can also use div instead of table
    jsfiddle[dot]net/aJPHa/2/
    <table>s should be used to display tabular data. Don't use <div>s when there is a more semantic element available.

    By the way, "display:tablerow" is not valid. You mean "display:table-row".
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0

    Table Heading centre


    You can use the caption tag that will display the top title in the center. Also you can place the title in hd tag and center align the text with colspan equal to no of columns.
  20. #11
  21. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    23
    Rep Power
    0
    1. If you want to place the Title of the table above it in Html then you can use caption tag and center alignment of it.
    2. If you want to give a common title to all its columns then you can use colspan tag which merges all common you want to merge them into a single column. These two options are used to give title of the table. The first on is used to place the tiltle outside the table border while the lower is used to place it inside the table border.
  22. #12
  23. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    45
    Rep Power
    0
    Yes, you can do it by using Colspan tag of html
  24. #13
  25. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,127
    Rep Power
    4304
    Originally Posted by pinkzebradesign
    Yes, you can do it by using Colspan tag of html
    "colspan" is an attribute, not a tag.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo