I have a table containing data. Tabular data. And it looks like this.

See this script .
Now I would like, when it is displayed on a narrower screen, so that the table looks so that you do not get a horizontal scroll bar and keep the same visual structure:

(or if you want, for example this script .)
Now my question is: how do you do this? I would prefer only CSS, but so far I have not been able to do this only in CSS. (The second script contains rowspan attributes that do not have CSS equivalents.)
HTML is created on the server side, so I can create one of two layouts depending on the width of the window, but then it will not respond to window resizing.
I am not against small Javascript, but in this case, in order to convert the first table to the second one to resize the window, it would have to be divided and rebuilt, by cell, and I think this is overkill. Still looking for a media query that can do all the work.
Experimenting a bit, I came to close it , but it does not work in IE8 and IE9.
So, does anyone have any ideas how to handle this? The ideal solution will work on table cells of various heights (2 lines of text or more) and for any number of columns.
html css responsive-design fluid-layout css-tables
Mr lister
source share