I am struggling with a table (made of divs). I need the row in the middle to extend to the full width of the table and with text in the center of the row (not the cell).
I do NOT want the whole thing to overflow-x
. And independently of the length of the text in this extended row, the width of the two main columns should not change.
So, basically, I would like an independent div, that needs to be inside the table.
How can I achieve that?
.divTable {
display: table;
margin: auto;
width: 100%
}
.divTableBody {
display: table-row-group;
}
.divTableRow {
display: table-row;
}
.divTableCell {
display: table-cell;
border: 1px solid blue;
}
.divTableCellExtended {
white-space: nowrap;
}
<div class="divTable">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">
some random text here
</div>
<div class="divTableCell">
some random text here
</div>
</div>
<div class="divTableRow">
<div class="divTableCellExtended">
some random text here long enough to extend out of single cell
</div>
</div>
<div class="divTableRow">
<div class="divTableCell">
some random text here
</div>
<div class="divTableCell">
some random text here
</div>
</div>
</div>
</div>