Reputation: 7772
So I have this sort of html
<div class="table-container">
<input type="text" class="some-class"/>
<table class="dataTable"/>
I want it so that the .some-class is always some percentage of the width of .dataTable(let's say 40%). I also want it so that if I append multiple table-containers(with the same children), that they appear below each other.
I've achieved the first requirement through the use of inline-block, but that means that these elements appear on the same line.
How do I achieve both?
JSFIDDLE- http://jsfiddle.net/9xR78/
Upvotes: 0
Views: 2795
Reputation: 8726
try this
.parent{
background-color : red;
display : inline-block;
float:left;
clear:both;
}
Upvotes: 1