How to display a row table behave like colspan = 3

I need two rows, the first has 3 columns, and the second I need to cover the entire width in the same way as it td colspan=3will do

Or display: table-cell; behave like colspan = 3

I use display: table-row; width: 100%;

How can I do that?

This is my CSS:

<style>
      .boxer {
         display: table;
         border-collapse: collapse;
      }
      .boxer .box-row {
         display: table-row;
      }
      .boxer .box-row-search {
         display: table-row;
         width: 100%;
      }
      .boxer .box {
         display: table-cell;
         text-align: left;
         vertical-align: top;
         border: 1px solid black;
      }
</style>
+4
source share
1 answer

Usage cannot ) (sadly there is no property either in CSS, so the stylesheet cannot mimic a valid element )display: table; colspan: 3;rowspan<table>

but hey flexhelp you!

.row{
  display: flex;
  flex-flow: wrap;
}
.cell{
  width: 25%;
  background:#eee;
}
.colspan2{
  flex: 2;
}
<div class="row">
  <div class="cell">Cell1</div>
  <div class="cell">Cell2</div>
  <div class="cell">Cell3</div>
  <div class="cell">Cell4</div>
  <div class="cell">Cell5</div>
  <div class="cell colspan2">Cell6 Colspan2</div>
  <div class="cell">Cell7</div>
</div>
Run codeHide result
+5
source

All Articles