HTML
  Home arrow HTML arrow Page 4 - HTML, CSS and Tables: The Beauty of Data
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

HTML, CSS and Tables: The Beauty of Data
By: Chris Heilmann
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 74
    2004-11-17

    Table of Contents:
  • HTML, CSS and Tables: The Beauty of Data
  • What is a table?
  • W3C to the rescue
  • Summary needed
  • Styling tables: the days of the spacer GIF
  • Embracing CSS and separating "what is what" and "what it looks like"
  • Our CSS

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    HTML, CSS and Tables: The Beauty of Data - Summary needed


    (Page 4 of 7 )

    A fully accessible table also needs a summary. Furthermore it is helpful to add a caption and structure the table into a THEAD and TBODY and TFOOT:

    <table summary="This table lists all the flights by XYZ Air leaving London today.">
      <caption>Flight Schedule</caption>
      <thead>
        <tr>

           <th scope="col">Flight Number:</th> 
          <th scope="col">From:</th> 
          <th scope="col">To:</th> 
          <th scope="col">Departure:</th> 
          <th scope="col">Arrival:</th> 
        </tr>

      </thead>
      <tfoot>
        <tr>
          <td colspan="5">Total: 3 flights</td>
        </tr>

      </tfoot>
      <tbody>
      <tr>
        <th scope="row">BA 3451</th>
        <td>Heathrow</td>

        <td>Nuremberg</td>
        <td>19:20</td>
        <td>19:50</td>
      </tr>

      <tr>
        <th scope="row">BA 1254</th>
        <td>Luton</td>
        <td>Alicante</td>

        <td>19:40</td>
        <td>20:50</td>
      </tr>
      <tr>
        <th scope="row">LH 331</th>

        <td>Heathrow</td>
        <td>Hamburg</td>
        <td>20:00</td>
        <td>20:20</td>

      </tr>
      </tbody>
    </table>

    The browser does not render all of these attributes, though:

    Flight Schedule
    Flight Number:From:To:Departure:Arrival:
    Total: 3 flights
    BA 3451HeathrowNuremberg19:2019:50
    BA 1254LutonAlicante19:4020:50
    LH 331HeathrowHamburg20:0020:20

    Notice that TFOOT must appear immediately after THEAD and before the first TBODY.

    Now that we have the HTML skeleton, let's paint it and turn it into something like this:

    Example of a styled table

    More HTML Articles
    More By Chris Heilmann


       · The article is only the start. I hope some of you might be tempted to go on...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT