Showing posts with label CSS tips. Show all posts
Showing posts with label CSS tips. Show all posts

Wednesday, November 23, 2011

Simple CSS tips to styling a Table


Styling a Tables in CSS is complicated by the fact that there are two different models available:
  • Collapsing borders



  • Seperate borders



  • The Collapsing borders allows one border to appear while the Seperate border allows multiple borders. The Seperate border is the default. Suppose we have the table:



















    W3C Membership
    TypeAmericaEuropePacificTotal
    Full622917108
    Affiliate24012347410
    Total30215264518


    If the style sheet is:

    table {border-collapse:seperate; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;}
    td{border:solid blue 1pt;}
    th{border:solid red 1pt;}


    The result would be:

    TableStyling1