Java Reference
In-Depth Information
Joe Asks. . .
Doesn't Stripes Have a Table Tag or Something?
Displaying HTML tables is a common task. Many libraries exist to
make it a breeze to create tables with sophisticated features.
In light of this, Stripes does not reinvent the wheel. Instead, it is
designed for easy integration of third-party libraries.
In that spirit, you can use Display Tag to jazz up your tables.
There are other libraries, of course, such as JMesa ( http://code.
google.com/p/jmesa )
and
ValueList
( http://valuelist.sourceforge.
net ) , to name a few.
Highlighting the Sorted Column
Display Tag also adds classes to <th> tags according to the currently
sorted column and the sort direction. Let's highlight this column with a
gradient shading, with the direction of the gradient indicating the sort
direction. After creating the ascending and descending gradient images,
this code styles the columns:
Download email_02/web/css/style.css
th.sorted {
background-color: #EECCAA;
}
th.order1 {
background-image: url(.. / images / gradient_asc.png);
}
th.order2 {
background-image: url(.. / images / gradient_desc.png);
}
Our Display Tag-powered table is now as shown in Figure 3.4 , on
the next page. We livened up the table with very little effort. Although
there's nothing wrong with generating HTML tables yourself, it's nice to
know that you can easily integrate your favorite library to do the work
for you.
 
 
Search WWH ::




Custom Search