The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

<html>
<head>
<title>HTML table tag in Embperl</title>
</head>
<body>
<p> $tabmode = default <p>
<hr><p>Display an two dimensional array with one, two and three columns !<BR>
Please take a look at the source in your browser to see the difference<BR>
[-
undef @a ;
undef @b ;
$a[0][0] = 'a1/1' ;
$a[1][0] = 'a2/1' ;
$a[1][1] = 'a2/2' ;
$a[2][0] = 'a3/1' ;
$a[2][1] = 'a3/2' ;
$a[2][2] = 'a3/3' ;
$b[0][0] = 'b1/1' ;
$b[1][0] = 'b2/1' ;
$b[1][1] = 'b2/2' ;
$b[2][0] = 'b3/1' ;
$b[2][1] = 'b3/2' ;
$b[2][2] = 'b3/3' ;
$maxcol=99 ;
-]
$a[0][[0] = '1/1' ;<BR>
$a[1][[0] = '2/1' ;<BR>
$a[1][[1] = '2/2' ;<BR>
$a[2][[0] = '3/1' ;<BR>
$a[2][[1] = '3/2' ;<BR>
$a[2][[2] = '3/3' ;<BR>
<P>$tabmode = default <P>
<table>
<tr>
<td>[+ $a[$row][0] +]</td>
</tr>
</table>
<table>
<tr>
<td>[+ $a[2][$col] +]</td>
</tr>
</table>
<table>
<tr>
<td>before[+ $a[$row][0] +]</td>
</tr>
</table>
<table>
<tr>
<td>before[+ $a[2][$col] +]</td>
</tr>
</table>
<table>
<tr>
<td>[+ $a[$row][0] +]after</td>
</tr>
</table>
<table>
<tr>
<td>[+ $a[2][$col] +]after</td>
</tr>
</table>
<table>
<tr>
<td>before[+ $a[$row][0] +]after</td>
</tr>
</table>
<table>
<tr>
<td>before[+ $a[2][$col] +]after</td>
</tr>
</table>
<table>
<tr>
<td>[+ $c[$row] +]</td>
</tr>
</table>
<table>
<tr>
<td>[+ $c[$col] +]</td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table border="4">
<tr>
<td>
<table>
<tr>
<td>[+ $b[$row][$col] +] </td>
</tr>
</table>
[+ $a[$row][$col] +] </td>
</tr>
</table>
<table border="5" width="100%">
<tr>
<td>[+ $b[2][$col] +]</td>
</tr>
<tr>
<td>[+ $a[2][$col] +] </td>
</tr>
</table>
<table border="6" width="100%">
<tr>
<td>[+ $a[$row+1][0] +]</td>
</tr>
<tr>
<td>[+ $a[$row][0] +] </td>
</tr>
</table>
<table border="6.1" width="100%">
<tr>
<td>[+ $a[$rows+1][0] +]</td>
</tr>
<tr>
<td>[+ $a[$rows][0] +] </td>
</tr>
<tr>
<td>[+ $rows +] </td>
</tr>
</table>
<table border="7">
<tr>
<TD BGCOLOR="[+ ($row & 1)?(($col&1)?'#7CFC00':'#A4A4B4'):(($col&1)?'#FFFF00':'#F4A460') +]">[+ $a[$row][$col] +] </td>
</tr>
</table>
[- $a[0][1] = 'a1/2' ; -]
<table border="8">
<tr>
<TD BGCOLOR="#F4A460">[+ $a[$row*2][$col*2] +] </td>
<TD BGCOLOR="#FFFF00">[+ $a[$row*2][$col*2+1] +] </td>
</tr>
<tr>
<TD BGCOLOR="#A4A4B4">[+ $a[$row*2+1][$col*2] +] </td>
<TD BGCOLOR="#7CFC00">[+ $a[$row*2+1][$col*2+1] +] </td>
</tr>
</table>
[- $a[0][1] = undef ; -]
[-
undef @regs ;
undef @kats ;
$regs[0]{Id} = 'Pfalz' ;
$regs[1]{Id} = 'Rheinhessen' ;
$kats[0]{Id} = 'Kultur' ;
$kats[1]{Id} = 'Sport' ;
-]
<table border="9" width="100%">
<tr>
<td><table border="10">
<tr>
<td valign="top">
<a href="inhalt.htm?Region=[+$regs[$row]{Id}+]">[+$regs[$row]{Id}+]</a></td>
</tr>
</table>
</td>
<td><table border="11">
<tr>
<td valign="top"><p align="left">
<a href="inhalt.htm?Kategorie=[+$kats[$row]{Id}+]">[+$kats[$row]{Id}+]</a></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
[-
$kats[2]{Id} = 'Veranstaltungen' ;
$kats[3]{Id} = '' ;
-]
<table border="12" width="100%">
<tr>
<td><table border="13">
<tr>
<td valign="top">
[- print LOG "row= $row regs=$regs[0]{Id}\n" ; 1 ; -]
[- print LOG "1row= $row regs=$regs[0]{Id}\n" ; $cmp = $regs[0]->{Id} ; print LOG "2row= $row regs=$regs[0]{Id}\n" ; 1 ; -]
[- while (($k, $v) = each (%{$regs[0]})) { print LOG "$v=$k;\n" ; } -]
[$if ($cmp || '') ne '' $]
<a href="inhalt.htm?Region=[+ do { print LOG "row= $row regs=$regs[0]{Id}\n" ; $regs[$row]{Id} } +]">[+$regs[$row]{Id}+]</a></td>
[$endif$]
</tr>
</table>
</td>
<td><table border="14">
<tr>
<td valign="top"><p align="left">
[- print LOG "row= $row regs=$kats[0]{Id}\n" ; 1 ; -]
[- $cmp = $kats[$row]{Id} -]
[$if ($cmp || '') ne '' $]
<a href="inhalt.htm?Kategorie=[+$kats[$row]{Id}+]">[+$kats[$row]{Id}+]</a></p>
[$endif$]
</td>
</tr>
</table>
</td>
</tr>
</table>
[-
# build tight loop table with array data, multidimensional 5x6
@array = sort ("Hello", "World", "2000", "Hello", "World", "2000");
@multi = (\@array, \@array, \@array, \@array, \@array);
-]
<table>
<tr bgcolor="[+ $row % 2?'gray':'white' +]">
<td align="center"><font size="+1">[+ $multi[$row][$col] +]</font></td>
</tr>
</table>
<table border="14"><tr><td>[+ $a[$row][0] +]</td></tr></table>
<table border="15"><tr><td>[+ $a[2][$col] +]</td></tr></table>
<table border="16"><tr><td>[+ $a[$row][$col] +]</td></tr> </table>
<table border="17">
<tr>
<td>[+ $a[$icon_height=$row][0] +]</td>
<td>
[- $icon_width = 5 ; -]
<IMG
[$ if (($server_type eq "iii")) $]
SRC="/i/www.[+ $server_type +]/[+ $badge || "iiilogo_narrow_if" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0"
[$ else $]
SRC="/icons/[+ $badge || "iiilogo_narrow_else" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0"
[$ endif $]
[$ if ($badge eq "iit") $]
ALT="iit logo"
[$ else $]
ALT="iii logo"
[$ endif $]>
</td>
</tr>
</table>
<table>
<tr>
<td>[+ $a[$row][0] +]</td>
</tr>
</table>
<table>
<tr>
<td>[+ $a[2][$col] +]</td>
</tr>
</table>
</body>
</html>