File: demo.table.phtml

package info (click to toggle)
eperl 2.2.14-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,164 kB
  • ctags: 348
  • sloc: ansic: 4,680; sh: 1,425; perl: 551; makefile: 378
file content (48 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (12)
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
<!--
##
##  demo.table -- ePerl demonstration webpage
##  Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved. 
##
-->
<html>
<head>
<title>demo.table</title>
</head>
<body>
<blockquote>
<blockquote>
<h1>demo.table</h1>
<h2>Low-level HTML programming</h2>

Instead of writing down the complex HTML table constructs for the
1x1 chart we program it with the control structures of Perl
language.

<p>
<table border=2>
<?
my $end = 12;

# top bar
print "<tr><th bgcolor=\"#e0e0f0\" align=right>x</th>";
for (my $i=1; $i <= $end; $i++) {
    print "<th bgcolor=\"#e0e0f0\" align=right>$i</th>";
}
print "</tr>";

# side bar and content
print"</tr>\n";
for (my $i=1; $i <= $end; $i++) {
    print "<tr><th bgcolor=\"#e0e0f0\" align=right>$i</th>";
    for (my $j=1; $j<= $end; $j++) {
        print "<td align=right>", $i*$j, "</td>";
    }
    print"</tr>\n"; 
}
!>
</table>

</blockquote>
</blockquote>
</body>
</html>