re: How to build a calendar with CSS Grid VIEW POST


I hate to be the one to point this out, and I'm as excited about CSS Grids as the next person, and perhaps this is just an interesting exercise to try with Grids... but semantically, this style of one-week-per-row calendars should really be coded using regular HTML tables. ;)


What makes tables a better choice?


Semantics! :) Tables are for representing tabular data, which this style of calendar most certainly is. Each row is a separate week; each column a day of the week. As a bonus, even if the CSS doesn't load properly, a table will display a calendar in an eminently-sensible layout, whereas a calendar built just with semantically-meaningless <div>s will just look like a mess of text strings.

Remember, the kick-back against HTML tables was targeted at their being (mis)used for page layout, NOT against their use with tabular data! :)

code of conduct - report abuse