Hi
For long now, I've been using a CSS class called clear
, which only has the rule clear: both
. I use it in the following way (shown in Django-syntax, but it is unimportant):
{% for item in collection %}
<ul class="horiz"><!-- horizontal list -->
<li>{{ item }}</li>
<li>{{ item }}</li>
</ul>
<div class="clear"></div>
{% endfor %}
As you can see, I'm doing a bunch of horizontal lists, to make it look just like a table. Imagine that the CSS rule .horiz li
implies float: left
. Note that I'm using <div class="clear"></div>
after each row in this "table", a lot of HTML for something so simple.
Is this really the way to go? Isn't there anything simpler that I just haven't thought about?