]> gitweb.hhaalo.de Git - calender.git/commitdiff
add: class names for month header
authorBastian Dehn <hhaalo@arcor.de>
Mon, 13 Dec 2021 18:54:18 +0000 (19:54 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 13 Dec 2021 18:54:18 +0000 (19:54 +0100)
cal.css
cal.js

diff --git a/cal.css b/cal.css
index 9b625b1e3ba8357327782cc1ca9d9e02405489c6..936e3b45b42490deb6db887daaf47fdd0e6e24e2 100644 (file)
--- a/cal.css
+++ b/cal.css
@@ -1,8 +1,13 @@
-table, th, td {
-       border: solid 1px black;
+table {
        border-collapse: collapse;
 }
 
-th:nth-child(even) {
+table .row.month th {
+       color: white;
+       background-color: gray;
+       border: solid 1px black;
+}
+
+table .row.monthday {
        background-color: lightgray;
 }
diff --git a/cal.js b/cal.js
index f61e56953693c6a77c68d928f2e526b806a065a9..7465e67f27c74b0d40e687ad5d847a9b18a43c9c 100644 (file)
--- a/cal.js
+++ b/cal.js
@@ -12,6 +12,8 @@ function addDaysOfMonth(tr, days)
 function addMonthDaysHeader()
 {
        let monthdaysheader = document.createElement("tr");
+       monthdaysheader.classList.add("row");
+       monthdaysheader.classList.add("monthday");
        let date = new Date();
 
        for (let i = 1; i < 13; i++) {
@@ -25,6 +27,8 @@ function addMonthDaysHeader()
 function addMonthHeader()
 {
        let monthheader = document.createElement("tr");
+       monthheader.classList.add("row");
+       monthheader.classList.add("month");
        const monthnames = [ "Januar", "Februar", "März", "April", "Mai", "Juni",
                "Juli", "August", "September", "Oktober", "November",
                "Dezember" ];