Can anyone think of a way to approach converting the following scheme into a non-table html layout?
A few things worth mentioning, perhaps.
Thanks in advance!
Ok.. it's VERY hard :) ..btw, if the text inside of it is 'static', you could do some tricks with floats and negative margins this way:
http://www.jsfiddle.net/steweb/Xa5X6/
I know it's not the best result, but it could be a way to start with :)
markup:
<div class="wrapper">
<div class="column">
<div id="sq-1"></div>
<div id="rect-1"></div>
</div>
<div class="column">
<div id="sq-2"></div>
<div id="rect-2"></div>
</div>
<div class="column main">
<div class="text-container-1">
<div class="text-1">
text
</div>
<div class="text-2">
text
</div>
</div>
<div class="text-3">text </div>
<div class="text-4">text</div>
<div class="text-5">text</div>
</div>
</div>
css:
.wrapper{
overflow:hidden;
background:#777;
display:inline-block;
}
.column{
float:left;
}
#sq-1{
width:20px;
height:21px;
}
#sq-2{
width:20px;
height:21px;
margin-top:20px;
border-top:2px solid #FFFFFF;
}
#rect-1{
height:104px;
border-right:2px solid #FFFFFF;
}
#rect-2{
height:82px;
border-right:2px solid #FFFFFF;
}
.text-container-1{
width:200px;
border-right:2px solid #FFFFFF;
}
.text-1, .text-2{
border-bottom:2px solid #FFFFFF;
}
.text-3{
float:left;
width:220px;
margin-top:-44px;
padding-top:54px;
padding-bottom:10px;
border-bottom:2px solid #FFFFFF;
border-right:2px solid #FFFFFF;
}
.text-4{
float:left;
width:240px;
margin-left:-222px;
margin-top:-44px;
padding-top:84px;
border-bottom:2px solid #FFFFFF;
border-right:2px solid #FFFFFF;
}
.text-5{
float:left;
width:260px;
margin-left:-242px;
margin-top:-44px;
padding-top:104px;
border-bottom:2px solid #FFFFFF;
border-right:2px solid #FFFFFF;
}
In this example, you have to assign static heights to the elements on the left. Moreover, the negative margins of the elements on the right are static too.
static text => static dimensions/margins => a kind of weird result
If the text is dynamic, I think achieving a result without using JS and/or tables is almost impossible, also because these 'L' elements and theirs widths/heights are hard to manage.
dynamic text => swearing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With