Hmmm maybe ..<br><br>html tableRow <br>          style: &#39;background:#ddd&#39;;<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">&lt;<a href="mailto:sorens@surfy.net">sorens@surfy.net</a>&gt;</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>
&gt;<br>
&gt;&gt; html table: [<br>
&gt;&gt;     collection withIndexDo: [:each :index |<br>
&gt;&gt;          html tableRow: [<br>
&gt;&gt;              html div class: (&#39;row&#39; , (index \\ 2) printString); with: [<br>
&gt;&gt;                   html<br>
&gt;&gt;                        tableData: each stuff1;<br>
&gt;&gt;                        tableData: each stuff2]]]]<br>
&gt;<br>
&gt; That&#39;s not valid HTML. Assign the class to the #tableRow and avoid<br>
&gt; putting a #div around the #tableData. See the senders of #table and<br>
&gt; #table: for various examples.<br>
&gt;<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: (&#39;row&#39; , (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&#39;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&#39;d rather specify the row colors programatically in my Seaside code.<br>
<br>
This doesn&#39;t seem like a difficult thing to do, but I&#39;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>