I have an html structure that can vary depending on the context of the page. On some pages it looks like this:
<div class="container"> <div class="column"> blah </div> </div>
And on others:
<div class="container"> <div class="column"> blah </div> <div class="column"> blah </div> </div>
Thus, the container has a liquid width (100%).
div .column also a fluid and should have the width of its container in the first example, i.e. 100%, and in the second example - 50% of the width and left aligned.
Like:
---------------------------- | | | column1 | | | -----------------------------
and
---------------------------- | | | | column2 | column2 | | | | -----------------------------
How can i do this?
I should also note that I cannot change the markup in column1 / column2 (I cannot add classes or something like that, perhaps only using javascript hacks or capturing php output and using regex :)
source share