Can CSS alternate row background color work with SpeedScript

Posted by runningtom8@gmail.com on 16-Feb-2015 00:44

How to solve an alternating rows background color for a dynamic table? using css?
The case below only has one TR.    Webspeed doesn't know what to do.

Is there a solution for this?


Here are the sample file that I am using to get alternate row background color to work with a dynamic data.


********* begin of sample.htm  file ***************************

{&OUT} "<table class=~"table2~">"
       "<tr>"
          "<td>" picked_by "</td>"
          "<td>" sort_by  "</td>"
          "<td>" items-pick "</td>"
          "<td>" string(int(my-pick),"HH:MM:SS") "</td>"
       "</tr>"
      "</table>".
end.
*********** end of sample.htm file ********************


********************  begin of table.css file *******************
.table2 tr:nth-child(odd){ background-color:#ee33ff; }
.table2 tr:nth-child(even)    { background-color:#ffffff; }

******************  end of table.css file ***********************



Thank you.
Tom

All Replies

Posted by Orchid Corpin on 19-Feb-2015 08:51

Hi Tom,

your code are all correct I just rewrite it into a valid css and html codes something like this below.

<style>
.table2 tr:nth-child(odd) { background-color:#ee33ff; }
.table2 tr:nth-child(even){ background-color:#ffffff; }
</style>

<table class="table2">
       <tr>
          <td> picked_by </td>
          <td> sort_by  "</td>
          <td> items-pick </td>
          <td> string(int(my-pick),"HH:MM:SS") </td>
       </tr>
	   <tr>
          <td> picked_by </td>
          <td> sort_by  "</td>
          <td> items-pick </td>
          <td> string(int(my-pick),"HH:MM:SS") </td>
       </tr>
	   <tr>
          <td> picked_by </td>
          <td> sort_by  "</td>
          <td> items-pick </td>
          <td> string(int(my-pick),"HH:MM:SS") </td>
       </tr>
</table>

Regards,

Orchid

This thread is closed