They all have different lengths, but the same width.
All divs look like this:
<div class="foo">
Stuff<br>
Things<br>
Widgets<br>
Gadgets<br>
(varying number of rows)
</div>


Moderators: phlip, Moderators General, Prelates


Moo wrote:Not elegant, no, but it works exactly as desired.
Moo wrote:These two people tell you why they don't think you should use CSS for layout:
http://www.flownet.com/ron/css-rant.html
http://blog.workaround.org/2009/03/17/d ... ge-layout/
The first link's layout is so simple it doesn't require any of the sort of layout he's talking about, and the second guy's using a standard Wordpress blog... I'm afraid I can't take your criticism very seriously either.b.i.o wrote:I might take them more seriously if either of them actually had a table-based layout on the page they're discussing.
<div id="pleasewait" style="display: none;"/>
<div id="master" style="display: none;">
<div id="left"/>
<div id="right"/>
</div>
<div id="work" style="display: none;">
<div class="left">Some stuff</div>
<div class="right">Some other stuff</div>
<div class="left custom">More stuff with extra styles</div>
</div>
<script type="text/javascript">
function doLayout()
{
jQuery(function($)
{
$('#master').fadeOut('fast', function() { $('#pleasewait').fadeIn('fast'); });
$('#left').html($('#work.left').html());
$('#right').html($('#work.right').html());
$('#pleasewait').fadeOut('fast', function() { $('#master').fadeIn('fast'); });
});
}
doLayout();
</script>
<script type="text/javascript">
jQuery(function($)
{
$('#work.left').html(content);
$('#work.right').html(content);
doLayout();
});
</script>
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
#container {
width: 100px;
}
.box {
float: left;
width: 48px;
border: 1px solid black;
}
.small {
height: 50px;
}
.medium {
height: 120px;
}
.large {
height: 180px;
}
.clear {
clear: both;
}
</style>
</head>
<body>
<div id="container">
<div class="box small">1</div>
<div class="box medium">2</div>
<div class="box medium">3</div>
<div class="box large">4</div>
<div class="box small">5</div>
<div class="box small">6</div>
<span class="clear"></span>
</div>
<script type="text/javascript">
var boxes = document.getElementById('container').getElementsByTagName('div');
// We know that the first box is always in the first column. We store
// it's left offset to find all other boxes in this column.
var firstColOffset = boxes[0].offsetLeft;
// Keep track of the relative height difference of the columns
var offset = 0;
// Pull up boxes in the left column to remove gaps
for (var i = 0; i < boxes.length; i++) {
var box = boxes[i];
// If it's in the first column
if (box.offsetLeft == firstColOffset) {
// Pull up the box if neccessary
box.style.marginTop = offset + 'px';
offset += box.offsetHeight;
} else {
offset -= box.offsetHeight;
}
}
</script>
</body>
</html>
Meaux_Pas wrote:I do that too, but for an entirely different reason.RealGrouchy wrote:I still remember the time when Gordon left. I still wake up in the middle of the night crying and screaming his name.
RealGrouchy wrote:Our daughter is in high school now.Gordon wrote:How long have I been asleep?!

Gordon wrote:Can't you just do this?
Users browsing this forum: No registered users and 4 guests