Java Reference
In-Depth Information
Figure 3.3: The list of contacts in a basic table
The code is more compact and more powerful. The <d:table> tag takes
the list of objects from
name=
and places each object in the variable
indicated in
id=
. The empty
requestURI=
"" parameter is necessary so that
the sorting URLs constructed by the Display Tag build on the Stripes
URL. The table is now sortable by column and is sorted by the first
column by default with
defaultsort=
"1".
Each <d:column> tag adds a column to the table, with the given
title=
and the data coming from the
property=
of each object. Each column is
made sortable by adding
sortable=
"true".
Shading Alternate Rows
Display Tag adds
class=
"odd" or
class=
"even" to the <tr> tags that it
generates. To shade these rows in different colors, you just have to
style them in the CSS file.
For example:
tr.odd {
background-color: #E5F5E5;
}
tr.even {
background-color: #FFFFFF;
}
Search WWH ::
Custom Search