Used for alternating colors in table where left most column is header.
The following parameters are recognized:
The heading to put in the left column.
The data to be displayed in right column.
Optional attributes for the header column (<td> entity).
Optional attributes for the right column (<td> entity).
This macro is very handy when building tables which have two columns. The first column is treated as a header column, the second column is used for displaying the data. Each time this macro is invoked, it toggles the state of the @tdEvenOddState() and @thEvenOddState() macros creating alternating styles for each row in the table.
Example of using the macro:
<table @htmlAttr("summary","Two Columns")> @trEvenOdd("Date","@now()") @trEvenOdd("Name","George") @trEvenOdd("Age","34",,"@htmlAttr("align","right")") </table>
Assuming the com.ccg.macros.at.All
class is within your CLASSPATH
and the
config/html.at
macros file has been
generated (Hint: run make atmacros in the
wui
directory), a developer should be able to
run the above example by copy/pasting from below:
[root@probe root]#
java com.ccg.macros.at.All <<EOF
@include("config/html.at",,"d")
<table @htmlAttr("summary","Two Columns")> @trEvenOdd("Date","@now()") @trEvenOdd("Name","George") @trEvenOdd("Age","34",,"@htmlAttr("align","right")") </table>
EOF
This macro is defined as:
<tr>@tdEvenOddToggle()@thEvenOddToggle() @thEvenOdd("@param(0)","@param(2)") @tdEvenOdd("@param(1)","@param(3)") </tr>