feat: Adding an order property for td/th or colgroup

I recently wondered why the order property only exists for flexbox and
grid. Imo it makes a lot of sense for the table element as well. Sometimes
you want to reorder columns and other is no convenient way to do so besides
changing the whole dom structure.

Adding an order property to td would tackle that issue. An obvious problem
is that you can easily create conflicts by setting different orders for tds
of the same column. That's why the better place to define this is probably
colgroup. However, it seems like the spec moved away of using colgroup at
all because all attributes (including width) seem to be deprecated. I find
this a bit strange because it allows a convenient way to define column
properties. Since tables are defined column-wise but are rendered row-wise,
it becomes hard to define column props without writing nth-child selectors
all the time. As written above, for ordering, nth-child doesn't seem to be
a proper solution anyway. Hiding or rearranging columns are powerful
features needed in a lot of rich web applications and providing an easy way
to do it in CSS would be awesome.

What do you think?

Received on Monday, 6 June 2022 13:03:55 UTC