Таблица и модальное окно

HTML

<!-- таблица -->
<table>
     <tr>
       <td><label for="modal-1"><img src="http://placehold.it/200x200/2ecc71/ecf0f1"></label></td>
       <td><label for="modal-2"><img src="http://placehold.it/200x200/2196f3/ecf0f1"></label></td>
     </tr>
     <tr>
       <td><label for="modal-3"><img src="http://placehold.it/200x200/009688/ecf0f1"></label></td>
       <td><label for="modal-4"><img src="http://placehold.it/200x200/9e9e9e/ecf0f1"></td>
     </tr>
</table>
<!-- Модальное окно №1 -->
<div class="modal">
  <input class="modal-open" id="modal-1" type="checkbox" hidden>
  <div class="modal-wrap" aria-hidden="true" role="dialog">
    <label class="modal-overlay" for="modal-1"></label>
    <div class="modal-dialog">
      <div class="modal-header">
        <h2>Модальное окно №1</h2>
        <label class="btn-close" for="modal-1" aria-hidden="true">×</label>
      </div>
      <div class="modal-body">
        <p>Здесь размещаете любое содержание...</p>
      </div>
      <div class="modal-footer">
        <label class="btn btn-primary" for="modal-1">Отлично!</label>
      </div>
    </div>
  </div>
</div>
<!-- Модальное окно №2 -->
<div class="modal">
  <input class="modal-open" id="modal-2" type="checkbox" hidden>
  <div class="modal-wrap" aria-hidden="true" role="dialog">
    <label class="modal-overlay" for="modal-2"></label>
    <div class="modal-dialog">
      <div class="modal-header">
        <h2>Модальное окно №2</h2>
        <label class="btn-close" for="modal-2" aria-hidden="true">×</label>
      </div>
      <div class="modal-body">
        <p>Здесь размещаете любое содержание...</p>
      </div>
      <div class="modal-footer">
        <label class="btn btn-primary" for="modal-2">Отлично!</label>
      </div>
    </div>
  </div>
</div>
<!-- Модальное окно №1 -->
<div class="modal">
  <input class="modal-open" id="modal-3" type="checkbox" hidden>
  <div class="modal-wrap" aria-hidden="true" role="dialog">
    <label class="modal-overlay"...

CSS

body{
    font-family: helvetica, arial;
    background: #fefefe;
}
/* Стили модального окна */
.modal-header h2 {
    color: #555;  
    font-size: 20px;
    font-weight: normal;
    line-height: 1;    
    margin: 0;
}
/* кнопка закрытия окна */
.modal .btn-close {
    color: #aaa;
    cursor: pointer;
    font-size: 30px;
    text-decoration: none;
    position: absolute;
    right: 5px;
    top: 0;
}
.modal .btn-close:hover {
    color: red;
}
/* слой затемнения */
.modal-wrap:before {
    content: "";
    display: none;
    background: rgba(0, 0, 0, .3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 101;
}
.modal-overlay {
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 102;
}
/* активация слоя затемнения и модального блока */
.modal-open:checked ~ .modal-wrap:before,
.modal-open:checked ~ .modal-wrap .modal-overlay {
    display: block;
}
.modal-open:checked ~ .modal-wrap .modal-dialog {
    -webkit-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    -o-transform: translate(-50%, 0);
    transform: translate(-50%, 0);
    top: 20%;
}
/* элементы модального окна */
.modal-dialog {
    background: #fefefe;
    border: none;
    border-radius: 5px;
    position: fixed;
    width: 80%;
    max-width: 500px;
    left: 50%;
    top: -100%;
    -webkit-box-shadow: 0 15px 20px rgba(0,0,0,.22),0 19px 60px rgba(0,0,0,.3);
    -moz-box-shadow: 0 15px 20px rgba(0,0,0,.22),0 19px 60px rgba(0,0,0,.3);
    box-shadow: 0 15px 20px rgba(0,0,0,.22),0 19px 60px rgba(0,0,0,.3);
    -webkit-transform: translate(-50%, -500%);
    -ms-transform: translate(-50%, -500%);
    -o-transform: translate(-50%, -500%);
    transform: translate(-50%, -500%);
    -webkit-transition: -webkit-transform 0.4s ease-out;
    -moz-transition: -moz-transform 0.4s ease-out;
    -o-transition: -o-transform 0.4s ease-out;
    transition: transform 0.4s ease-out;
    z-index:...