So I just found out about css3 columns
specification and immediately saw that I can use it to "modernize" my forum listing which uses a dynamically generated table.
The code to generate the table is quite complex as it determines itself whether or not to place the next database row's data into a new row in the table or into a new column. Using the css3 columns way, I assume that I can simply let the code read the data into the page and leave css3 to decide what's supposed to go into which column.
I've come across a bit of a problem though. When using it, the content isn't split across the specified number of columns.
Here's some code for reference:
.2col {
column-count: 2;
column-width: 400px;
column-gap: 10px;
column-rule: 1px solid #e1e1e1;
}
<div class="cats 2col">
<div class="title">
<div class="t">
<h2><a href="#" class="sh" id="t1">-</a> Title 1</h2>
</div>
<section>
<div class="cat">
<p>Category 1<span>This is the first category</p>
</div>
<div class="cat">
<p>Category 2<span>This is the second category</p>
</div>
<div class="cat">
<p>Category 3<span>This is the third category</p>
</div>
</section>
</div>
<div class="title">
<div class="t">
<h2><a href="#" class="sh" id="t1">-</a> Title 2</h2>
</div>
<section>
<div class="cat">
<p>Category 1<span>This is the first category</p>
</div>
<div class="cat">
<p>Category 2<span>This is the second category</p>
</div>
</section>
</div>
</div>
I set up this JSFiddle for testing: http://jsfiddle.net/LYoung/JLVEs/1/
Clearly I'm doing something wrong. Can anyone help me identify what that is and why it's wrong?