css - Making a table with only divs -


i want make table divs cell-1 cell-2 , cell-3:

the table fluid: width: 90%; max-width: 960px;

cell-1 , cell-3 fixed: width: 100px;

cell-2 fluid: width: (current table width - 200px) , can smaller.

just in table 2 cells fixed width , other fluid covers rest of table width.

how that?

thanks.

while bad answer without op posting code show @ least trying something, here solution (had near ready doing):

html

<div class="table">     <div class="table-row">         <div class="table-cell">100</div>         <div class="table-cell">fluid</div>         <div class="table-cell">100</div>     </div> </div> 

css

.table {     display:table;     width: 90%;     max-width: 960px;     border:1px solid blue; /* looks */ }  .table-row {     display:table-row; }  .table-cell {     display:table-cell;     border:1px solid red;/* looks */ }  .table-row > .table-cell:first-child, .table-row > .table-cell:last-child {     width:100px;     background-color:lightgray; /* looks */ } 

demo @ jsfiddle


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -