Показать сообщение отдельно
  #4 (permalink)  
Старый 11.10.2016, 11:51
Лаборант :-)
Отправить личное сообщение для Pavel M. Посмотреть профиль Найти все сообщения от Pavel M.
 
Регистрация: 08.11.2011
Сообщений: 806

можно привязаться к атрибуту rowspan
вместо
#text_scheduleBox tr:nth-child(2n+3){
    background-color: #FFAFB1;
}

#text_scheduleBox tr:nth-child(2n) td:nth-child(n+2){
    background-color:  #ADCFFF;
}

использовать
#text_scheduleBox td:not([rowspan]) {
    background-color: #FFAFB1;
}
#text_scheduleBox td[rowspan] ~ td{
    background-color: #ADCFFF;
}

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">

#text_scheduleBox table, #text_scheduleBox th {
    text-align: center;
    vertical-align: middle;
    margin: 1%;
    padding: 1.5%;
    border: 1px solid black;
}

#text_scheduleBox td {
    width: auto;
      margin: 1%;
     border: 1px solid black;
}

#text_scheduleBox td:not([rowspan]) {
    background-color: #FFAFB1;
}
#text_scheduleBox td[rowspan] ~ td{
    background-color: #ADCFFF;
}
    
  </style>
</head>
<body>

              <div id="text_scheduleBox">

            <fieldset>
                    <legend> OUR SCHEDULE </legend>
                        <table>

  <tr>
    <th>Time</th>
    <th>Monday</th>
    <th>Tuesday</th>
    <th>Wednesday</th>
    <th>Thursday</th>
    <th>Friday</th>
    <th>Saturday</th>
    <th>Sunday</th>
  </tr>
  <tr>
    <td rowspan="2">9-00...11-00</td>
    <td>Abraham</td>
    <td>Dmitry</td>
    <td>Abraham</td>
    <td>Dmitry</td>
    <td>Eugene</td>
    <td>Oleg</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
  </tr>
  <tr>
    <td rowspan="2">11-00...13-00</td>
    <td>Abraham</td>
    <td>Oleg</td>
    <td>Abraham</td>
    <td>Oleg</td>
    <td>Eugene</td>
    <td>Oleg</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
  </tr>
  <tr>
    <td rowspan="2">13-00...15-00</td>
    <td>Abraham</td>
    <td>Dmitry</td>
    <td>Abraham</td>
    <td>Dmitry</td>
    <td>Eugene</td>
    <td>Oleg</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
  </tr>
  <tr>
    <td rowspan="2">15-00...17-00</td>
    <td>Abraham</td>
    <td>Oleg</td>
    <td>Eugene</td>
    <td>Oleg</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
  </tr>
  <tr>
    <td rowspan="2">17-00...19-00</td>
    <td>Eugene</td>
    <td>Oleg</td>
    <td>Eugene</td>
    <td>Oleg</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
    <td>-</td>
    <td>Evgeniya</td>
  </tr>
  <tr>
    <td rowspan="2">19-00...21-00</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
    <td>Abraham</td>
    <td>Evgeniya</td>
    <td>-</td>
    <td>Evgeniya</td>
  </tr>
  <tr>
    <td rowspan="2">21-00...23-00</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Eugene</td>
    <td>Dmitry</td>
    <td>Dmitry</td>
  </tr>
  <tr>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
    <td>-</td>
  </tr>
</table>


            </fieldset>

            </div>

</body>
</html>
Ответить с цитированием