it sounds funny but I have problems to find an elegant solution to create a certain layout and hope to find here some hints from other users.
I want to create this layout:
These are the requirments:
the whole component has a certain width. the component with a and b have a certain width, e.g. 200px. c gets the remaining space for its width. c defines a certain height. a and b together should have the same height like c. a has a certain height, but its unknown. it is calulcated in the end and can't be used for calculations because it can change. but after the rendering it has a certain height. b should use the remaining space for its height, e.g. height of c - height of a. in the end b can be larger than the available space, so it should use the scrolling-y function. you should see a scrollbar if the component becomes bigger than the available height.
I tried different approaches, e.g. floating, tables, but there are always force me to set a certain height for b.
I would be glad if someone could give an advice for a proper solution.
Edit:
My approach with the tables: http://jsfiddle.net/f7c6dzfL/
.test {
border: 1px solid red;
height: 400px;
display: table;
width: 100%;
}
.test .left {
display: table-cell;
border: 1px solid red;
width: 50%;
}
.test .left .top {
border: 1px solid blue;
width: 100%;
height: 100px;
}
.test .left .bottom {
border: 1px solid blue;
width: 100%;
max-height: 100%;
overflow-y: scroll;
}
.test .right {
display: table-cell;
width: 50%;
}
<div class="test">
<div class="left">
<div class="top"></div>
<div class="bottom">
<ul>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
<li>asd</li>
</ul>
</div>
</div>
<div class="right"></div>
</div>