Horizontal data-table material

Asked

Viewed 28 times

0

I have a json that returns the data structure below, where I populate a data-table.

    {TimeStamp: "2019-08-07T03:30:00.000Z", Value: "377.5", Quality: 3}
    {TimeStamp: "2019-08-07T03:40:00.000Z", Value: "362.5", Quality: 3}
    {TimeStamp: "2019-08-07T03:50:00.000Z", Value: "367.5", Quality: 3}
    {TimeStamp: "2019-08-07T04:00:00.000Z", Value: "345", Quality: 3}
    {TimeStamp: "2019-08-07T04:10:00.000Z", Value: "347.5", Quality: 3}

Everything is working normally with the table formatted as below.

Tabela dados

The problem is that now I need to invert the table to work with a multi-day survey, ie I would have the multiple columns being one for each day.

Something like:

nova tabela

There is the possibility to use data-table or I will have to use pure html?

  • It was not clear your doubt, what the problem of the material table, your problem is popular the table with json?

  • I don’t think I explained it properly, the doubt is in changing the orientation, I need to group the values per day and create dynamically a column for each day with their respective records below.

  • 1

    Man I don’t know, this is kind of weird, will have a column for each day, IE, will have 30 to 31 columns in this table, imagined how this would get bad. In the image you put has 6 columns , now imagine these 6 columns multiplied by 5 more columns to give the 30 columns, and in mobile, I think it will not roll this way not there, gives a rethought there.

  • In fact, presenting a table with 30 columns does not make much sense. Perhaps it would be better to use a table with pagination. Then you would show only 1 day, with two columns, and let the user click the next day or choose a specific day.

  • It really gets weird, actually the search will be limited to 10 dais and we will not have mobile access...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.