1

I am aware of the named areas in CSS grid, which is useful but requires you specify both column and row and can not expand after that. However, I need a table with infinite rows. I want to place each row's data to its corresponding column by assigning it to its named column. I've looked up the MDN and other sources but didn't find specific knowledge. Could someone here point out a direction? Thanks.

columnA   ColumnB  ColumnC
dataA      dataB    dataC
.....      .....    ....
[namedA]  [namedB]  [namedC]
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Jinghui Niu
  • 990
  • 11
  • 28

1 Answers1

0

The CSS Grid specification provides for named grid areas, as you have noted.

It also provides for unnamed grid areas.

However, there is nothing in the Grid specification that allows for named grid tracks (columns/rows).

In fact, there is nothing in CSS in general that allows for targeting columns or rows.

You'll either need to use an explicit grid (allowing for defined positioning of grid areas) or JavaScript.

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701