Game Development Reference
In-Depth Information
<tr class = "odd"><td> 2nd result </td></tr>
<tr class = "problem">
<td> Problematic 3rd result</td></tr>
<tr class = "odd"><td> 4th result </td></tr>
</TABLE>
</BODY>
</HTML>
In Listing 9-2, you alternate the class of your table rows as they are being written out. You define a red background
for problematic entries and set this as the table row class of any entry you want to alert the user to. See Figure 9-1 for a
simple visualization of Listing 9-2.
Figure 9-1. A CSS coloring sample
CSS gives you the functionality to make a log more manageable for users by providing custom views and more
navigable by replacing plain text with formatted information. A simple way to do this would be to change the display
property of an element to none when styling an element. This approach allows you to hide chunks of a log.
Your CSS styling data can either be written out as part of the HTML log or stored as a separate file. By storing the
CSS data as a separate file on the user's machine, you can use it as a configuration file that specifies which data to
include and how to display it.
Intelligent Reporting and Interactivity with JavaScript
Using HTML and CSS allows you to create richly formatted logs. However, by adding JavaScript, you open up
the possibilities for intelligent reporting and interactivity.
 
Search WWH ::




Custom Search