-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArrayToTableHeader.php
51 lines (47 loc) · 1.32 KB
/
ArrayToTableHeader.php
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
<?
function ArrayToTableHeader($table, $rows, $cols, $align = "center")
{
global $horizontal_id;
global $vertical_id;
print("<br>");
print("<table align=\"" . $align . "\" border=\"1\">\n");
print("<tr>\n");
print("<td> </td>\n");
print("<td> </td>\n");
for ($i = 0; $i < $cols; $i++) {
print("<td><b>");
print($horizontal_id[$i]);
print("</b></td>\n");
}
print("</tr>");
print("<tr>\n");
print("<td> </td>\n");
print("<td> </td>\n");
for ($i = 0; $i < $cols; $i++) {
print("<td align=\"center\"><b>");
print($i);
print("</b></td>\n");
}
print("</tr>");
for ($i = 0; $i < $rows; $i++) {
print("<tr>\n");
print("<td><b>");
print($vertical_id[$i]);
print("</b></td>\n");
print("<td width=\"20\" height=\"20\" align=\"center\"><b>");
print($i);
print("</b></td>\n");
for ($j = 0; $j < $cols; $j++) {
print("<td width=\"20\" height=\"20\" align=\"center\">");
if ($table[$i][$j] == 1 or $table[$i][$j] == 0) {
print($table[$i][$j]);
} else {
print(" ");
}
print("</td>\n");
}
print("</tr>\n");
}
print("</table>\n");
print("<br>");
}