Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang = "sr">
- <head>
- <meta charset = "UTF-8">
- <!-- Reset za CSS-->
- <link rel="stylesheet" type="text/css" href = "http://meyerweb.com/eric/tools/css/reset/reset.css">
- <title>Raspored Časova</title>
- <style type="text/css">
- table {
- margin: 0 auto;
- border: 1px solid #ccc;
- text-align: left;
- }
- th {
- font-weight: bold;
- }
- td, th {
- padding: 7px 150px 7px 7px;
- border-bottom: 1px solid #ccc;
- }
- tr {
- background: #fff;
- }
- tbody tr:nth-of-type(odd) {
- background: #ddd;
- }
- </style>
- </head>
- <body>
- <?php
- function printTable($table) {
- $tableLen = count($table);
- for ($i = 0; $i < $tableLen; $i++) {
- echo "<tr>\n";
- for ($x = 0; $x < 4; $x++) {
- echo "<td>" . $table[$i][$x] . "</td>\n";
- };
- echo "</tr>\n";
- };
- };
- ?>
- <table>
- <thead>
- <tr>
- <th>ID</th>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Email</th>
- </tr>
- </thead>
- <tfoot></tfoot>
- <tbody>
- <?php
- $users = array(
- array("1", "Peter", "Andersen", "peter@gmail.com"),
- array("2", "John", "Miller", "john@gmail.com"),
- array("3", "Thomas", "Swift", "thomas@gmail.com")
- );
- printTable($users);
- ?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement