tabledecorator.html 1.09 KB
Newer Older
1 2 3 4 5 6 7
<div id="resultbody" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/">
  <py:if test="defined('table_headline') and (table_headline)">
    <h3>${table_headline}</h3>
  </py:if>
  <py:if test="defined('before') and (before)">
    ${before}
  </py:if>
8 9
  <py:if test="defined('table_header') and defined('table') and len(table_header) > 0 and len(table) > 0">
    <table border="1">
10
      <tr>
11
	<py:for each="thidx,th in enumerate(table_header)">
12
	  <th class="col${thidx}">${th}</th>
13 14
	</py:for>
      </tr>
15
      <py:for each="tridx,tr in enumerate(table)">
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
        <py:choose>
	  <py:when test="(tridx % 2) == 1">
	    <tr class="even">
	      <py:for each="tdidx,td in enumerate(tr)">
		<td class="col${tdidx} ${td[1]}">${td[0]}</td>
	      </py:for>
	    </tr>
	  </py:when>
	  <py:otherwise>
	    <tr class="odd">
	      <py:for each="tdidx,td in enumerate(tr)">
		<td class="col${tdidx} ${td[1]}">${td[0]}</td>
	      </py:for>
	     </tr>
	  </py:otherwise>
	</py:choose>
32 33 34
      </py:for>
    </table>
  </py:if>
35 36 37 38
  <py:if test="defined('after') and (after)">
    ${after}
  </py:if>
</div>