<body>
  
  <div class="colgrid">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
    <div class="item">10</div>
    <div class="item">11</div>
    <div class="item">12</div>
    <div class="item">13</div>
    <div class="item">14</div>
    <div class="item">15</div>
    <div class="item">16</div>
    <div class="item">17</div>
    <div class="item">18</div>
    <div class="item">19</div>
    <div class="item">20</div>
    <div class="item">21</div>
    <div class="item">22</div>
    <div class="item">23</div>
    <div class="item">24</div>
    <div class="item">25</div>
    <div class="item">26</div>
    <div class="item">27</div>
    <div class="item">28</div>
    <div class="item">29</div>
    <div class="item">30</div>
  </div>
  
</body>
.colgrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: auto;
  
  /* Other */
  width: fit-content;
  margin: 0 auto;
  background-color: lightgray;
  
  place-items: center;
  grid-gap: 10px;
}


/* 
    OTHER STUFF
*/

.item {
  width: 5vmax;
  min-width: 40px;
  height: 5vmax;
  min-height: 40px;
  background-color: darkslateblue;
  color: white;
  border-radius: 5px;
  
  display: flex;
  justify-content: center;
  align-items: center;
}

body {
  background-color: whitesmoke;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.