From: David Polakovic Date: Sat, 9 Sep 2023 10:24:15 +0000 (+0200) Subject: styles moved to css X-Git-Url: http://git.dpolakovic.space/?a=commitdiff_plain;h=1821f81ae8b55914681fb016a81fc58f4ed36913;p=my-website
styles moved to css --- diff --git a/Styles/styles.css b/Styles/styles.css index e8d15bb..acbbda6 100755 --- a/Styles/styles.css +++ b/Styles/styles.css @@ -32,6 +32,26 @@ body { font-family: noto-serif; } +table { + border-collapse: collapse; + border: 1px solid grey; + width: 100%; +} + +th { + background-color: #c69879; + border: 1px solid grey; +} + +td { + padding: 2px; + border: 1px solid grey; +} + +tr:hover { + background-color: #efdac3; +} + /* Navigation bar just simple bar from W3 schools with minor edits https://www.w3schools.com/Css/css_navbar_horizontal.asp diff --git a/clue.php b/clue.php index fb74f16..6e98d9a 100644 --- a/clue.php +++ b/clue.php @@ -63,9 +63,7 @@ $rows = explode('*', $fileContents); // Create the table - // the styles must be set here because the css won't work - // properly with this php monster - echo '
'; + echo '
'; // Process each row foreach ($rows as $key => $row) { @@ -84,8 +82,7 @@ // Use
for the first row, for the rest $cellTag = $isFirstRow ? 'th' : 'td'; - // again... sorry for the styles - echo '<' . $cellTag . ' style="padding: 2px; border: 1px solid grey">' . htmlspecialchars($column) . ''; + echo '<' . $cellTag . '>' . htmlspecialchars($column) . ''; } // End the table row diff --git a/lib.php b/lib.php index eaee183..cca808c 100644 --- a/lib.php +++ b/lib.php @@ -64,9 +64,7 @@ $rows = explode('*', $fileContents); // Create the table - // the styles must be set here because the css won't work - // properly with this php monster - echo ''; + echo '
'; // Process each row foreach ($rows as $key => $row) { @@ -85,8 +83,7 @@ // Use
for the first row, for the rest $cellTag = $isFirstRow ? 'th' : 'td'; - // again... sorry for the styles - echo '<' . $cellTag . ' style="padding: 2px; border: 1px solid grey">' . htmlspecialchars($column) . ''; + echo '<' . $cellTag . '>' . htmlspecialchars($column) . ''; } // End the table row