A table ruler is a helpful mechanism that allows the user to highlight sections of a selected HTML table every time the mouse is placed over each of its rows. Naturally, this simple rollover effect permits users to keep track of the row currently being viewed, in this way increasing the table’s overall usability. This is the third article in a four-part series on creating table rulers.
Making Table Rulers Work with Multiple Tables - Review: building a table ruler that targets a single HTML table (Page 2 of 4 )
Before I start teaching you how to create a table ruler that will be capable of targeting multiple HTML tables, it’d be pretty convenient to spend a few moments recalling the hands-on example developed in the preceding tutorial, where I explained how to create the same web application, but targeting only one table.
That being said, here’s the full source code of the aforementioned example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Now that you’ve taken a look at the above code sample, hopefully you’ll be pretty familiar with building a table ruler that highlights the rows of a single HTML table, right? As you can see, the previous example utilizes a small JavaScript application to implement the rollover effect on a targeted HTML table, a process that should be quite easy for you to grasp.
At this stage, I reintroduced a concrete example that demonstrates how to develop a simple table ruler that works with a single table. So, what's next? Well, as I explained at the beginning, it’s perfectly possible (and desirable, actually) to extend the functionality of this web application to provide it with the capacity for using multiple tables.
Therefore, assuming that you’re interested in learning how to achieve this with minor hassles, in the following section I’ll be modifying the small JavaScript application that you saw before so it can apply the table ruler effect to several HTML tables.
Click on the link that appears below and keep reading.