
September 24th, 2004, 05:47 AM
|
|
Registered User
|
|
Join Date: Mar 2001
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
HTML-layout problem with XSLT
Hi!
I´m trying to make create a html-table using XSLT. The result i want is something like this
<tr class="styleOdd"><td>Some text</td></tr>
<tr class="styleEven"><td>Some other text</td></tr>
The problem is that I have no idea how to get it to switch the class (styleOdd/StyleEven) for every row in the table. How is it possible to "know" which one that is to be outputted?
In "PHP-language" for i.e the same thing would look something like this
<?php for ($i = 0; $i < $y; $i++) {
if ($i % 2 == 0) {
echo "<tr class=\"styleEven\"><td>Some text</td></tr>";
} else {
echo "<tr class=\"styleOdd\"><td>Some text</td></tr>";
}
} ?>
Need I say that I´m new to XSLT 
|