Html-tables—rowspan

Hello,

When writing code for a table that contains headings both at the top (col) and at the side (row) of the table, must one include the “scope” attribute in the tags to properly render the table?

In the following code for instance, Saturday and Sunday are rendered at the top while Morning, Afternoon and Evening are rendered at the side of the rows, even without specifying their “scope”

Saturday Sunday
Morning Work Relax
Afternoon
Evening Dinner

https://www.codecademy.com/journeys/full-stack-engineer/paths/fscj-22-web-development-foundations/tracks/fscj-22-fundamentals-of-html/modules/wdcp-22-learn-html-tables-6d939404-9baa-4c0a-b70b-229635097539/lessons/html-tables/exercises/rowspan

Hello!

The scope attribute applies no visual effect and is not inherently required to render a table on the screen. However, the scope attribute has accessibility implications and should always be used when creating a table so screen readers can properly relay the data.

At this point in the full-stack course, I’m not sure if accessibility has been covered, but it’s always important to implement!

I hope this helps. :slight_smile:

Thank you. Appreciate the prompt and helpful response :slightly_smiling_face:

1 Like