I have more than five to six column it will increase in the future. I have to display each row with three column. So how do I force the column to display in the next row? I set parent class display: table
and child class display:table-cell
because I have to display the equal height of the column.
I am getting the output like this
I need output like this.
.table {
display: table;
border-collapse: separate;
border-spacing: 30px 0px;
width: 100%;
}
.row { display:table-row;width: 100%; }
li{
display:table-cell;
padding:5px;
background-color: gold;
width: 33.33%;
text-align: center;
}
<div class="table">
<ul class="row">
<li>Cell 1</li>
<li>Cell 2</li>
<li>Cell 3</li>
<li>Cell 4</li>
<li>Cell 5</li>
<li>Cell 6</li>
</ul>
</div>
In the Microsoft Visual Basic for Applications window, double click ThisWorkbook in the left pane to open the ThisWorkbook (Code) window. Then copy and paste the below VBA code into the window. Note: In the VBA code, “A” is the beginning cell column of the next row. You can change it as you need.
Select any one or more (but preferably all) cells in the row you want moved, go to Format> Paragraph> Line & Page Breaks, check the Keep with next box, then OK.
The general rule is, the pane will be frozen ABOVE and to the LEFT of the cell (s) you have selected. For example, if you want to freeze ROW 1, select all of ROW 2, if you want to freeze COLUMN A, select all of COLUMN B, if you want to freeze ROW 1 AND COLUMN A, select CELL B2, etc.
Sub jumpnext() Range("A" & ActiveCell.Row + 1).Select End Sub. Note: In the VBA code, “A” is the beginning cell column of the next row. You can change it as you need. 3. Press the F5 key, then the cursor will move to the beginning of next row immediately.
I prefer this one as well. You can see here: JSFiddle
* {
box-sizing: border-box;
}
.table .row {
display: flex;
flex-wrap: wrap;
list-style:none
}
.table .row li {
background: orange;
width: 33%;
text-align: center;
line-height: 100px;
border: 5px solid white;
}
.table + .table li {
background: olive;
}
<div class="table">
<ul class="row">
<li>Cell 1</li>
<li>Cell 2</li>
<li>Cell 3</li>
<li>Cell 4</li>
<li>Cell 5</li>
<li>Cell 6</li>
</ul>
</div>
<div class="table">
<ul class="row">
<li>Cell 1</li>
<li>Cell 2</li>
<li>Cell 3</li>
<li>Cell 4</li>
</ul>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With