2

I read other posts on SO about the matter but before you all start yelling at me just use tables for tabular data! let me say that this is an attempt to solve specific <table/> problems:

  • having a scrollable tbody: mandatory for big data and virtual scrolling

  • have the thead columns and tbody columns auto-adjust with the best fit based on the cell contents (not all equally-wide and without manually specifying width on each of them): which you now loose once you declare display:block the tbody

I was trying to leverage the display:contents or display:subgrid (ff and chrome with experimental flags enabled) for this.

Is what I'm trying to achieve even possible?

In my attempt I'm posting here:

  • I'm loosing the chance to set an height on my tbody because of the display:contents which let the children behave direct children of the container parent (table)

  • I'm not sure whether I can nest display:contents elements

Here the snippet: https://codepen.io/anon/pen/ppWwKv

Other references:

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Damiano Barbati
  • 3,356
  • 8
  • 39
  • 51
  • I’m not going to yell at you, but you should absolutely leave tabular data in tables, and start by reading Richard Rutter on readability of tables https://alistapart.com/article/web-typography-tables and these design patterns by Andrew Coyle. – denmch Jan 14 '18 at 15:58
  • @denmch thanks for the link, I totally agree with all being said. But I don't see the point: what we are talking about here, is having the same "table visual features" but with a more flexible "code" structure. Data is always tabular. But as I stated, a scrollable tbody is indeed mandatory for virtual list capabilities and having columns auto-fitting the content would be desired as well. You can't have this now with
    but maybe you can with
    . The way you're going to style them is your business, and I agree with you and the article guidelines on that.
    – Damiano Barbati Jan 14 '18 at 19:24
  • Why can't you have that with a table that's semantically a table? This whole line of thinking makes me sad. – denmch Jan 14 '18 at 22:28
  • 2
    @denmch!!! once again ==> ```scrollable tbody is indeed mandatory for virtual list capabilities and having columns auto-fitting the content would be desired as well``` – Damiano Barbati Jan 15 '18 at 08:59

0 Answers0