Good afternoon I have a table that registers: date! hour ! type, as you can see, the data is registered vertically, that is, in the first row it would be something like this: 2018-02-20 08:00:00 Start, second row: 2018-02-20! 12: 00: 00! departure lunch, 3rd row: 2018-02-20! 13:00:00! Arrival lunch, fourth row: 2018-02-20! 5:00 pm! There are many records, what I want is for the on-screen sample to print something like this: Date! Start ! departure lunch! lunch arrival! exit, in the row below leave the date values, below start: 08:00:00, below departure lunch: 12:00:00, below Arrival of lunch: 13:00:00, below Departure 17: 00:00, I have tried to put the data in an array but when crossing it with foreach (), it all goes horizontal, I look for after output, the rest is written in a new row and cells