I have a problem in HTML. I have divided the HTML page into two columns:
My code:
<div id="outer">
<div id="inner1">
<div id="data1">
</div>
<div id="response">
</div>
</div>
<div id="inner2">
<div id="data2">
</div>
</div>
</div>
My CSS:
#outer {
background-color:#FFFF99;
}
#inner1 {
float: left;
width: 62%;
}
#inner2 {
float: right;
width: 38%;
}
I need to insert another column #inner1_2
in between inner1
and inner2
which is the optional one.
There is also a third column:
<div id="#inner1_2">
</div>
The problem here is the variable division. Either I have three columns or two columns depending on the data:
inner2
is fixed- If there are three columns of data,
.inner1
needs to be split into two halves, otherwise.inner1
remains as it is.
This is more complex logic than I am comfortable with in CSS.
What is the best way to handle this?