so I have a <div>
with display:table;
and it has like 10 children (the count may vary, the children may be buttons or inputs) with display:table-cell;
and I have set the width of all children except for one. I want the last one children without fixed width to fill the width.
For example, let's say that the parent <div>
has width of 600px, there are 4 buttons, each with width of 40px, I want to fifth element to have a width of 440px without setting it staticaly.
This is what I have done so far:
HTML:
<div class="table">
<button class="show"></button>
<div class="id">TEXT</div>
<div class="username">TEXT</div>
<div class="dob">TEXT</div>
<button class="edit"></button>
<button class="delete"></button>
</div>
And the CSS: div
.table {
display:table;
width:100%;
height:40px;
}
div.table > * {
display:table-cell;
height:40px;
line-height:40px;
}
div.table > button {width:64px;}
div.table > div.id {width:48px;}
div.table > div.dob {width:128px;}
//EDIT: The element I want to fill the space is div.username