Hmmm maybe ..<br><br>html tableRow <br> style: 'background:#ddd';<br> with: [html tableData: [.....]]<br><br>Cheers <br>Gerhard<br><br><br><div class="gmail_quote">On Sun, Mar 22, 2009 at 9:22 PM, Sorensen <span dir="ltr"><<a href="mailto:sorens@surfy.net">sorens@surfy.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br>
Lukas Renggli wrote:<br>
><br>
>> html table: [<br>
>> collection withIndexDo: [:each :index |<br>
>> html tableRow: [<br>
>> html div class: ('row' , (index \\ 2) printString); with: [<br>
>> html<br>
>> tableData: each stuff1;<br>
>> tableData: each stuff2]]]]<br>
><br>
> That's not valid HTML. Assign the class to the #tableRow and avoid<br>
> putting a #div around the #tableData. See the senders of #table and<br>
> #table: for various examples.<br>
><br>
<br>
</div>Thanks to both Gerhard and Lukas for pointing out the problem with my<br>
Seaside code. I changed it to:<br>
<div class="im"><br>
html table: [<br>
collection withIndexDo: [:each :index |<br>
</div> html tableRow class: ('row' , (index \\ 2) printString); with: [<br>
<div class="im"> html<br>
tableData: each stuff1;<br>
tableData: each stuff2]]]<br>
<br>
</div>and the code works.<br>
<br>
After looking at the result, though, I wonder if I may ask how to go about<br>
implementing a further enhancement.<br>
<br>
The application that I wrote is in essence an amortization table in which<br>
each row corresponds to a month; there are many months of data, so<br>
alternating the row colors helps make the table more readable. In my<br>
stylesheet, I have<br>
<br>
.row1 {background-color: #ddd; color #000}<br>
.row2 {background-color: #888; color#000}<br>
<br>
The enhancement I have in mind involves grouping the colors so that each<br>
year holds the same set of alternating row colors, but as the year changes<br>
then the alternating row colors take on a different shade of color. Here's<br>
an example:<br>
<br>
2009 Jan background-color: #ddd; color #000<br>
2009 Feb background-color: #ff0; color#000<br>
2009 Mar background-color: #ddd; color #000<br>
2009 Apr background-color: #ff0; color#000<br>
...<br>
2009 Nov background-color: #ddd; color #000<br>
2009 Dev background-color: #ff0; color#000<br>
<br>
2010 Jan background-color: #ddd; color #000<br>
2010 Feb background-color: #0ff; color#000<br>
2010 Mar background-color: #ddd; color #000<br>
2010 Apr background-color: #0ff; color#000<br>
...<br>
2010 Nov background-color: #ddd; color #000<br>
2010 Dec background-color: #0ff; color#000<br>
<br>
Rather than try to define tags in the stylesheet<br>
<br>
.row0 {background-color: #ddd; color #000}<br>
.row1 {background-color: #ff0; color#000}<br>
.row2 {background-color: #0ff; color #000}<br>
.row3 {background-color: #f0f; color#000}<br>
<br>
I'd rather specify the row colors programatically in my Seaside code.<br>
<br>
This doesn't seem like a difficult thing to do, but I'm afraid my Seaside<br>
HTML rendering ability is rather weak at the moment. Can someone help me<br>
out?<br>
<br>
Thanks, Soren<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://www.nabble.com/How-to-alternate-table-row-colors-without-WATableReport-tp22512359p22650151.html" target="_blank">http://www.nabble.com/How-to-alternate-table-row-colors-without-WATableReport-tp22512359p22650151.html</a><br>
</font><div class="im">Sent from the Squeak - Seaside mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br>