I'm creating a table with div
s. I'm able to create it, but there is this instance where in there is a row where I need to do a merge and center.
Here is my code.
.divTable {
display: table;
width: 100%;
}
.divTableRow {
display: table-row;
}
.divTableCell {
border: 1px solid #999999;
display: table-cell;
padding: 3px 10px;
}
.divTableBody {
display: table-row-group;
}
<div class="divTable">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">$2</div>
<div class="divTableCell">1</div>
</div>
<div class="divTableRow">
<div class="divTableCell"> 6</div>
</div>
</div>
</div>
Here I want 6
to be in center. How can I achieve this?
basically like below table
<table border="1px solid black">
<tr>
<td>$2</td>
<td>1</td>
</tr>
<tr>
<td colspan="2" align="center">6</td>
</tr>
</table>