Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML CSS table fill space in parent element

I use tables inside tables. I want that the child table fills the parent table cell. Is this possible?

Also, is it possible for a table column to fill the remaining space without shrinking the other columns (not like width='90%' which may force some other columns to get truncated)?

like image 244
DbSchema Avatar asked Nov 01 '22 11:11

DbSchema


1 Answers

I guess these can help you: http://jsfiddle.net/B26zm/

  1. When you give width:100% to a table, it will fill the width of its parent cell.

  2. You need to define a width for the table, and width for all columns 'except' the one you need to be flexible. That way, the column with no width, will expand/shrink to match the width you define for the table.

like image 143
Taylan Aydinli Avatar answered Nov 08 '22 05:11

Taylan Aydinli