I am trying to mimic an HTML table with css classes, but the last "cell" element always gets pushed to the next line.
The way I am currently getting around this is to decrease the width of the last element by a few percent, so that the total width of the elements adds up to ~ 97%. This protects the last element from being pushed to the next line, but it doesn't look as nice because there's unused space at the end.
Is there a way to get the table cells to line up nicely and use 100% of the containing width?
.cell {
display: inline-block;
}
<div class="table" style="width: 100%">
<div class="row" style="width: 100%">
<div class="cell" style="width:40%">Last Name</div>
<div class="cell" style="width:40%">First Name</div>
<div class="cell" style="width:20%">Age</div>
</div>
</div>