about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/4/3.php
diff options
context:
space:
mode:
Diffstat (limited to 'usth/ICT3.2/prac/4/3.php')
-rw-r--r--usth/ICT3.2/prac/4/3.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/usth/ICT3.2/prac/4/3.php b/usth/ICT3.2/prac/4/3.php
new file mode 100644
index 0000000..7d71043
--- /dev/null
+++ b/usth/ICT3.2/prac/4/3.php
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<style>
+table, th, td {
+    border: 1px solid black;
+    border-collapse: collapse;
+}
+th, td { padding: 1em }
+th { font-weight: bold }
+</style>
+
+<body>
+  <table>
+    <thead>
+      <tr>
+        <th><?=
+          implode("</th>\n        <th>",
+                  ['Firstname', 'Lastname', 'Age']);
+        ?></th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr><?=
+        implode("\n      </tr>\n      <tr>",
+                array_map(fn($row) => "\n        <td>"
+                                      . implode("</td>\n        <td>", $row)
+                                      . "</td>",
+                          [['Jill', 'Smith', 50],
+                           ['Eve', 'Jackson', 94],
+                           ['John', 'Doe', 80]]))
+      ?></tr>
+    </tbody>
+</body>
+</html>