Проблема с разметкой мобильного стола. Как правильно отобразить мои данные? - PullRequest
0 голосов
/ 05 сентября 2018

У меня уже есть таблица, в которой уже указан размер мобильного телефона, моя проблема:

  1. завтрак должен быть в области описания строки (без текста описания слева)
  2. Шведский стол на одной линии с завтраком
  3. тогда цена должна быть в той же строке завтрака
  4. Я также хочу, чтобы итог отображался внизу таблицы, а не посередине.
  5. Как не отображать описание и проверочное слово для многократного отображения.
  6. Как я могу показать это только в одной таблице? Ваша помощь и предложение высоко ценится

/*
	Max width before this PARTICULAR table gets nasty. This query will take effect for any screen smaller than 760px and also iPads specifically.
	*/
	@media
	  only screen 
    and (max-width: 760px), (min-device-width: 768px) 
    and (max-device-width: 1024px)  {

		/* Force table to not be like tables anymore */
		table, thead, tbody, th, td, tr {
			display: block;
		}

		/* Hide table headers (but not display: none;, for accessibility) */
		thead tr {
			position: absolute;
			top: -9999px;
			left: -9999px;
		}
       .hidden{
        display: none;
    }

    tr {
      margin: 0 0 1rem 0;
    }
      
    tr:nth-child(odd) {
      background: #ccc;
    }
    
		td {
			/* Behave  like a "row" */
			border: none;
			border-bottom: 1px solid #eee;
			position: relative;
			padding-left: 50%;
		}

		td:before {
			/* Now like a table header */
			position: absolute;
			/* Top/left values mimic padding */
			top: 0;
			left: 6px;
			width: 45%;
			padding-right: 10px;
			white-space: nowrap;
		}

		/*
		Label the data
    You could also use a data-* attribute and content for this. That way "bloats" the HTML, this way means you need to keep HTML and CSS in sync. Lea Verou has a clever way to handle with text-shadow.
		*/
		td:nth-of-type(1):before { content: "Description"; }
		td:nth-of-type(2):before { content: "Check-in"; }
		td:nth-of-type(3):before { content: "Check-out"; }
		td:nth-of-type(4):before { content: "Room Type"; }
		td:nth-of-type(5):before { content: "Number of Persons"; }
		td:nth-of-type(6):before { content: "Total"; }
		td:nth-of-type(7):before { content: ""; }
		td:nth-of-type(8):before { content: ""; }
		td:nth-of-type(9):before { content: ""; }
		td:nth-of-type(10):before { content: ""; }
      td:nth-of-type(10):before { content: ""; }
      td:nth-of-type(10):before { content: ""; }
      td:nth-of-type(10):before { content: "Breakfast"; }
	}
<table role="table">
  <thead role="rowgroup">
    <tr role="row">
      <th role="columnheader">Description</th>
      <th role="columnheader">Check-in</th>
      <th role="columnheader">Check-out</th>
      <th role="columnheader">Room Type</th>
      <th role="columnheader">Number of Persons</th>
      <th role="columnheader">Total</th>
    </tr>
  </thead>
  <tbody role="rowgroup">
    <tr role="row">
      <td role="cell">Room</td>
      <td role="cell">06-09-2018</td>
      <td role="cell">07-09-2018</td>
      <td role="cell">Large Type</td>
      <td role="cell">2</td>
      <td role="cell">1,900-</td>
    </tr>
    <tr role="row">
      <td role="cell">Breakfast</td>
      <td role="cell">Breakfast Buffet</td>
      <td class="hidden"></td>
      <td class="hidden"></td>
      <td class="hidden"></td>
      <td role="cell">90-</td>
     
    </tr>
    <tr role="row">
      <td role="cell">total</td>
      <td class="hidden"></td>
      <td class="hidden"></td>
      <td class="hidden"></td>
      <td class="hidden"></td>
      <td role="cell">1,900</td>
    </tr>
  </tbody>
</table>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...