Actually, how to make it so that, conditionally speaking, the page is opened from the mobile, then one, the last cell in the row goes to the next new row?

    1 answer 1

    To make up the table using a div using display: table and other things for the desktop, and for mobiles to use media queries and manipulate the display as necessary.

    An example of a table on a div:

    div { margin: 5px; padding: 5px; border: 1px dotted white; } .table { display: table; background: #d9edf7; border-color: #3a87ad; } .row { display: table-row; background: #f2dede; border-color: #b94a48; } .cell { display: table-cell; background: #fbeed5; border-color: #c09853; } 
     <div class="table"> <div class="row"> <div class="cell">Город</div> <div class="cell">Посещения</div> <div class="cell">Страниц</div> <div class="cell">Время</div> </div> <div class="row"> <div class="cell">СПБ</div> <div class="cell">500</div> <div class="cell">6</div> <div class="cell">00:08:05</div> </div> </div>