How to deal with tables on narrow displays

I have created two tables with the same data. One of them is connected to a custom form (item_template). While on the wide display both look legible:

on the narrow display the first table is illegible (it would be more illegible with more columns):

The second table converted the columns to rows (which I like), but the headers stayed as columns.

Is it possible to make both data and headers change to rows on narrow screens? Something like [responsive]="true" for tables in PrimeNg. How do you deal with it?

Hi @Luke,

Check out the wrap_on attribute of the DataGrid component!

1 Like

Thank you @meredydd

It’s better but not perfect:

Is it possible to achieve a two-column layout like below?
image

If there were some way to know if the data grid was going to be or has now been wrapped, then you could create labels for the columns to the left of the items in each cell, and then hide them by setting visibility to False , then only showing them if the data grid becomes wrapped.

I recall someone wrote a Horizontal Grid component, mentioned on this Forum. If that would help, it might be worth a quick Search.

Might be a sledge-hammer but you could create both styles and hide one or the other based on the view width.

1 Like