HTML
CSS
JS

Responsive Table with Vertically Stacked Cells

A responsive table that will change layout when in mobile view. In the normal desktop view, this table looks just like any other table, but once the screen size is less than 600, it will become a table with vertically stacked cells.

This is done by using the data-label attribute. Whatever changes you make to the table heading, you need to modify the data-label as well. In mobile view, data-label becomes the table header.

If you want to show the headers on its own row in mobile view, you can add this code display: block;to CSS line 77.

';