in reply to Re: Code and html separation - always or mostly doable?
in thread Code and html separation - always or mostly doable?
If you only speak of two colors, it's quite easy in the template system I use (and I guess, even easier on standard Template systems).
I create an array (call it @array) on my perl program, containing hashes. One of the hash elements is named "bgcolor" and is actually a boolean value. Let's say for example that it also has a "content" value which is string and a "cnt" value which is integer (a counter).
The code notation provided works for HTMLTP, but it should work anywhere as the logical part.
<table> <!--: ascending array :--> <tr class="<!--: if bgcolor :-->colored<!--: else :-->noncolored<!--: +end :-->"><td>[:cnt:]</td><td>The content of the [:cnt:]th element is + : [:content:]</td></tr> <!--: end :--> </table>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Code and html separation - always or mostly doable?
by saberworks (Curate) on Jun 17, 2004 at 05:53 UTC | |
by Michalis (Pilgrim) on Jun 17, 2004 at 09:28 UTC | |
by saberworks (Curate) on Jun 17, 2004 at 17:01 UTC |