Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > HTML Forum & Tutorial


Make it easier to identify cells using titles in your tables


Reply
Views: 3166  
Thread Tools Rate Thread
  #1  
Old 08-09-2010, 12:25 PM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default Make it easier to identify cells using titles in your tables

If you have long tables with multiple columns on your pages, at least one page long, you may run into the problem of not being able to see the column titles when you're near the bottom of the table. You could repeat the column titles every so often in your table, but this is not an elegant solution because of varying screen sizes.
So what else can you do? Let HTML 4.0 come to your rescue.
Let's take a look at the following table:
















A B C
1 2 3

Listing #1 : HTML code. Download tablet1 (0.22 KB).


Result:
A B C 1 2 3
Now, let's add TITLE attributes to the above table's data cells as follows and check the difference.
















A B C
1 2 3

Listing #2 : HTML code. Download tablet2 (0.24 KB).


Result:
A B C 1 2 3
Didn't notice a difference? Try moving your mouse over the above table's data cells using a HTML 4.0 compatible browser such as Explorer 4.x. You'll see a pop-up hint window appear with the name of each column. Even if you're unable to see the column titles and the data cells at the same time, you can get a quick reminder of the column you're looking at simply by moving your mouse over the cells.
By the way, you can add titles to the whole table as well (instead of individual cells), as follows:





Listing #3 : HTML code. Download tablet3 (0.22 KB).


Result:
Move your mouse over here if you want to see something...

Reply With Quote
Reply

Tags
website tips

New topics in HTML Forum & Tutorial





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)