About Grids


#1

Hey guys,

I got into grids today. My feeling is that Grid is an improved version of tables?

https://www.codecademy.com/courses/learn-css-grid/lessons/css-grid-i/exercises/review?action=resume_content_item&course_redirect=learn-css


#2

Tables when used as intended don’t need to be improved upon. They are for marking up data. Grid is a layout tool, not a table.


#3

Thank you for your answer. I see. So you are saying that tables shouldn’t be used for layout but only for presenting data?


#4

Given everything at our disposal for adaptive and responsive layouts it would no longer be a viable consideration to use tables in layout. Tables are quite rigid and contain more structure than a typical layout would require. As data containers they are ideally suited to that role. If it’s tabular data, then use a table.

Conversely, using grids or other layouts to present tabular data is semantically incorrect since each grid section is independent of the others and search engines would have a hard time indexing. Tables give scope to columns and rows and data is related to its neighboring elements, beside, above or below.


#5

Very informative! Thank you!


#6

FYI, this adaptation is a direct paste-in of markup and style rules from,

Table example

It only took a couple of tweaks to make ti work.