From 70bc1075c7c9283b3b7d94d2f4e9e22782fea036 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 13 Dec 2021 19:54:18 +0100 Subject: [PATCH] add: class names for month header --- cal.css | 11 ++++++++--- cal.js | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cal.css b/cal.css index 9b625b1..936e3b4 100644 --- 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 f61e569..7465e67 100644 --- 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" ]; -- 2.39.5