Responsive Tables in Pure CSS
techblog.livingsocial.com
Responsive Tables in Pure CSS
1–10 of 74 posts
Re: Responsive Tables in Pure CSS
#2Re: Responsive Tables in Pure CSS
#3He did this and added some reader submissions on other approaches.
Re: Responsive Tables in Pure CSS
#4I have a tiny jQuery plugin to stick a span inside a cell to form the heading at small sizes, but I like the data-attribute approach better. I think I'll change my plugin to do it this way now.
Related: Hey Travis and Will, nice work on this!
Re: Responsive Tables in Pure CSS
#5Re: Responsive Tables in Pure CSS
#6Re: Responsive Tables in Pure CSS
#7Re: Responsive Tables in Pure CSS
#8The original table's border is removed, and every tr is styled to look like a table by giving it a border. tds are turned into rows by setting display:block. The td rows are given row headers using pseudo elements, which pulls their content from an attribute on the corresponding td.
Re: Responsive Tables in Pure CSS
#9This is a great approach for when you have complete control over your markup. If it's user-generated (like a table in the body of a post in a CMS, for example), it gets trickier. I have a tiny jQuery plugin to stick a span inside a cell to form the heading at small sizes, but I like the data-attribute approach better. I think I'll change my plugin to do it this way now. Related: Hey Travis and Will, nice work on this…
Re: Responsive Tables in Pure CSS
#10Chris Coyier - 4 years ago. He did this and added some reader submissions on other approaches. https://css-tricks.com/responsive-data-tables/