Hi,
I have a problem with rendering complex table. I want to get callendar-like
view with style per quarter of hour:
<table>
<tbody>
<tr class="row0in15"><td align="center" valign="center" rowspan="4">0</td><td> </td></tr>
<tr class="row15in15"><td> </td></tr>
<tr class="row30in15"><td> </td></tr>
<tr class="row45in15"><td> </td></tr>
<tr class="row0in15"><td align="center" valign="center" rowspan="4">1</td><td> </td></tr>
<tr class="row15in15"><td> </td></tr>
<tr class="row30in15"><td> </td></tr>
<tr class="row45in15"><td> </td></tr>
<tr class="row0in15"><td align="center" valign="center" rowspan="4">2</td><td> </td></tr>
<tr class="row15in15"><td> </td></tr>
<tr class="row30in15"><td> </td></tr>
<tr class="row45in15"><td> </td></tr>
etc...
And I am not able to produce PageTemplate to achieve that:
<table>
š <tbody tal:define="step python:15">
ššš <tr tal:repeat="minutes python:range(0,24*60,step)"
ššššššš class="row45in15"
ššššššš tal:attributes="class string:row${minutes}in${step}">
ššššš <td tal:define="hour python:minutes/60"
ššššššššš tal:condition="python:((minutes%60)==0)"
ššššššššš tal:attributes="rowspan python:60/step"
ššššššššš align="center" valign="center" rowspan="12"
ššššššššš tal:content="hour">10</td>
ššššš <td> </td>
ššš </tr>
š </tbody>
</table>
The above produces wrong class attribute for <tr>.
The tal:attributes should look like attributes="class string:row${python:minutes%60}in${step}".
But TALES string: "${}" substitute can contain only global-name
or path only. I am not able to use global-name because I have no place to
define it due to TAL execution order: define-repeat-attributes.
Note that I am unable to use <tbody tal:repeat=...><tr tal:define=...
tal:attributes=...> trick due to other limitations. I want to get
precisely the above view. Any hints appreciated.
Thank you,
m.