Hallo, ich suche nach einer Möglichkeit verschachtelte Tabellen mit HTML::Template einzusetzten.
<table>
<tr>
<td>
<table id="Mitarbeiter"> (...) </table>
</td>
</tr>
<tr>
<td>
<table id="Detailinformation"> (...) </table>
</td>
</tr>
<table>
Wenn ich es auf die rustikale Art mache kann das so aussehen:
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
#!/usr/bin/perl -w
use strict;
use warnings;
use DBI;
my ($dbh, $sth);
$dbh = DBI->connect ("DBI:mysql:host=192.168.0.1;database=myDB",
"user", "pw", {PrintError => 0, RaiseError => 1});
&fetch_ent();
$dbh->disconnect();
exit(0);
sub fetch_ent {
my $sth = $dbh->prepare (" SELECT Firma, Strasse, PLZ, Ort, EID
FROM firma
WHERE Firma LIKE 'N%'
");
$sth->execute();
while (my ($firma, $strasse, $plz, $ort, $eid) = $sth->fetchrow_array()) {
print "<tr bgcolor='#EEEEEE'><td>\n",
"<table class='blind'><tr>",
"<td>$firma</td><td>$strasse</td><td>$plz</td><td>$ort</td>",
"</tr></table>",
"</td></tr>\n",
"<tr bgcolor='#FFFFDD'><td>\n";
&fetch_contact($eid);
print "</td></tr>\n";
}
$sth->finish();
}
sub fetch_contact {
my $eid = shift @_;
my $sth = $dbh->prepare (" SELECT Name, Vorname
FROM person
WHERE EID = '$eid'
");
$sth->execute();
while (my ($nachname, $vorname) = $sth->fetchrow_array()) {
print "<table class='blind'><tr>",
"<td>$nachname</td><td>$vorname</td>",
"</tr></table>";
}
$sth->finish();
}
Gruss,
Ronnie\n\n
<!--EDIT|Ronnie|1066808661-->