Categories > TinyButStrong general >

dynamic colors in table

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: kyle
Date: 2005-03-01
Time: 20:04

dynamic colors in table

Hi,

First, thank you for making such a great toolset available under open source.

It there a way to dynamically set the background color of each row in a table when creating a block
using mysql? The color is based on data retrieved from the mysql table.

Thanks, Kyle.
By: mochin
Date: 2005-03-01
Time: 20:50

Re: dynamic colors in table

Sure, first see the examples and after do:
<html>
....
  <tr bgcolor="[blk2.row_color]"> <--- see this line
    <td>[blk2.#]</td>
    <td>[blk2.res_name;block=tr]</td>
    <td> <div align="right">[blk2.res_score]</div></td>
    <td> <div align="center">[blk2.res_date;frm='mm-dd-yy']</div></td>
  </tr>
....
</html>

where [blk2.row_color] it's your new row color, from the database.

Try this, Mochin
By: kyle
Date: 2005-03-01
Time: 21:04

Re: dynamic colors in table

Thanks Mochin.

Which example is this? It still doesn't seem to be working.

Kyle.