Leser: 1
6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use strict;
use warnings;
use Template;
my @rows = (
{ foo => 1, bar => 1, baz => 1 },
{ foo => 2, bar => 2, baz => 2 },
{ foo => 3, bar => 3, baz => 3 },
{ foo => 4, bar => 4, baz => 4 },
);
my @titles = sort keys %{$rows[0]};
my $t = Template->new();
$t->process(\*DATA, { rows => \@rows, titles => \@titles });
__END__
<table>
<tr>
[%- FOREACH title = titles %]
<th>[% title %]</th>
[%- END %]
</tr>
[%- FOREACH terms = rows %]
<tr>
[%- FOREACH term = terms.keys.sort %]
<td>[% terms.$term %]</td>
[%- END %]
</tr>
[%- END %]
</table>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<table>
<tr>
<td> </td>
<!-- TMPL_LOOP TAGESZAHLEN -->
<td><!-- TMPL_VAR TAGESZAHL --></td>
<!-- /TMPL_LOOP TAGESZAHLEN -->
</tr>
<tr>
<td> </td>
<!-- TMPL_LOOP WOCHENTAGE -->
<td><!-- TMPL_VAR WOCHENTAG --></td>
<!-- /TMPL_LOOP WOCHENTAGE -->
</tr>
<!-- TMPL_LOOP ALLE_TEAMZEILEN -->
<tr>
<td><!-- TMPL_VAR TEAMBEZEICHNUNG --></td>
<!-- TMPL_LOOP DATEN_EINES_TEAMS -->
<td><!-- TMPL_VAR WERT_DES_TEAMS --></td>
<!-- /TMPL_LOOP DATEN_EINES_TEAMS -->
</tr>
<!-- /TMPL_LOOP ALLE_TEAMZEILEN -->
</table>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<table>
<tr>
<td> </td>
<td>1.Juli</td>
<td>2.Juli</td>
<td>3.Juli</td>
<td>usw ...</td>
</tr>
<tr>
<td> </td>
<td>So</td>
<td>Mo</td>
<td>Di</td>
<td> </td>
</tr>
<tr>
<td>Team 1</td>
<td>12</td>
<td>23</td>
<td>55</td>
<td> </td>
</tr>
<tr>
<td>Team 2</td>
<td>14</td>
<td>3</td>
<td>86</td>
<td> </td>
</tr>
<tr>
<td>Team 3</td>
<td>5</td>
<td>41</td>
<td>74</td>
<td> </td>
</tr>
<tr>
<td>Team 4</td>
<td>9</td>
<td>58</td>
<td>2</td>
<td> </td>
</tr>
<tr>
<td>Team 5</td>
<td>22</td>
<td>0</td>
<td>3</td>
<td> </td>
</tr>
<tr>
<td>usw...</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<!-- /TMPL_LOOP JE_TEAM_EINE_ZEILE -->
</table>
1
2
3
4
...
<td class="<!-- TMPL_VAR CSS_STYLE -->"><!-- TMPL_VAR WERT_DES_TEAMS -->
...
</td>
6 Einträge, 1 Seite |