Таблицы

In this example below you will see how to do a Таблицы with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by EvgenStor, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright EvgenStor ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Таблицы</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div id="table">
  <div>
    <div></div>
    <div></div>
  </div>
  <div>
    <div></div>
    <div></div>
  </div>
  <div>
    <div></div>
    <div></div>
  </div>
  <div>
    <div></div>
    <div></div>
  </div>
</div>

<div class="table-2">
  <div class="table-row">
    <div class="table-cel">1</div>
    <div class="table-cel">2</div>
    <div class="table-cel">3</div>
  </div>
  <div class="table-row">
    <div class="table-cel">1</div>
    <div class="table-cel">2</div>
    <div class="table-cel">3</div>
  </div>
  <div class="table-row">
    <div class="table-cel">1</div>
    <div class="table-cel">2</div>
    <div class="table-cel">3</div>
  </div>
</div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/EvgenStor/andx422andx430andx431andx43bandx438andx446andx44b-yoKbKO */
*{
  margin: 0;
  padding: 0; 
}
#table > div{
  display: block;
  box-sizing: border-box;
  background: #000;
  width: 50%;
  padding: 5px;
  margin-bottom:5px ;
  
}

#table > div > div{
  display: block;
  box-sizing: border-box;
  background: #555;
  `width: 100%;
  height: 50px;
 margin: 5px;
}

/* #table div:last-child{
  background: green;
}*/

.test {
  background: green!important;
}

.table-2 {
  display: table;
  float: left;
  width: 100%;
  border: 1px solid #000;
  text-align: center;
}
.table-row {
  display: table-row;
  
}
.table-cel {
  display: table-cell;
  padding: 10px;
  border: 1px solid #000;
}

/*Downloaded from https://www.codeseek.co/EvgenStor/andx422andx430andx431andx43bandx438andx446andx44b-yoKbKO */
$('#table > div:last-child').addClass('test');

Comments