about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/4/3.php
blob: 7d7104324634b720f6c2acb933b2f189525bbbfa (plain) (blame)
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
<!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>