Re: [htmltmpl] formatting output of recursive functions
Brought to you by:
samtregar
From: Ron S. <ro...@de...> - 2003-09-25 23:37:38
|
On Thu, 25 Sep 2003 16:38:49 +0200, Ralf Ullrich wrote: Hi Ralf See below. >=3D> $html) and this works fine. but this is bad if you want to= style >certain rows in a different way from other rows. But i don't= know >how to >handle this with TMPL_LOOP, since I never can know, how many >children >exist for one parent and how deep this hierarchy will be. >has anyone on this list done something like this and could point= me >in >the right direction? I see Karen has given you some ideas. To create a crude tree-like structure within a table, try= prefixing the rows with multiple white boxes and then an 'elbow' box. Demo images: http://www.deakin.edu.au/~rons/html/black-and-white-boxes.html This method is trivial, but may help. Also, learn how to use H::T's __first__ etc tokens to change the= CSS class of a <td>, etc. Demo: =09<tmpl_loop name =3D outer_result_loop> =09=09<tmpl_if name =3D __first__> =09=09=09<tr> =09=09=09=09<tmpl_loop name =3D inner_result_loop> =09=09=09=09=09<td class =3D "headbox"> =09=09=09=09=09=09<tmpl_var name =3D result_td> =09=09=09=09=09</td> =09=09=09=09</tmpl_loop> =09=09=09</tr> =09=09<tmpl_else> =09=09=09<tr> =09=09=09=09<tmpl_loop name =3D inner_result_loop> =09=09=09=09=09<td> =09=09=09=09=09=09<tmpl_var name =3D result_td> =09=09=09=09=09</td> =09=09=09=09</tmpl_loop> =09=09=09</tr> =09=09</tmpl_if> =09</tmpl_loop> -- Ron Savage, ro...@de... on 26/09/2003. Room EF 312 Deakin University, 221 Burwood Highway, Burwood, VIC 3125,= Australia Phone: +61-3-9251 7067, Fax: +61-3-9251 7604 http://www.deakin.edu.au/~rons |