A dynamic calendar is built with JavaScript, which works out the days of the current month and writes them into an HTML table.
<h3 id="title"></h3>
<table border="1" id="cal"></table>
<script>
const today = new Date();
const y = today.getFullYear(), m = today.getMonth();
const names = ["January","February","March","April","May","June",
"July","August","September","October","November","December"];
document.getElementById("title").textContent = names[m] + " " + y;
const firstDay = new Date(y, m, 1).getDay(); // 0 = Sunday
const daysInMonth = new Date(y, m + 1, 0).getDate();
let html = "<tr><th>Su</th><th>Mo</th><th>Tu</th><th>We</th>"
+ "<th>Th</th><th>Fr</th><th>Sa</th></tr><tr>";
for (let i = 0; i < firstDay; i++) html += "<td></td>";
for (let d = 1; d <= daysInMonth; d++) {
const mark = d === today.getDate() ? " style='background:yellow'" : "";
html += "<td" + mark + ">" + d + "</td>";
if ((firstDay + d) % 7 === 0) html += "</tr><tr>";
}
document.getElementById("cal").innerHTML = html + "</tr>";
</script>
new Date(y, m, 1).getDay() gives the weekday of the 1st, so that many empty cells are added first. new Date(y, m + 1, 0).getDate() gives the number of days in the month. A new row starts after every Saturday, and today's date is highlighted. Because the dates are calculated, the calendar is always correct for the current month; prev/next buttons can change m and redraw it.