Multiple Columns in Koha’s Bootstrap Theme 1


Many of our partners have a table on their main page listing new titles in their collection. Tables, however, are not responsive and so that cause issues on mobile devices when they upgrade to the Bootstrap theme. Today I learned about a built-in function of Bootstrap that makes it easy to emulate a table without actually creating a table. Bootstrap has 12 “columns” defined in it so you can easily create a multi-column display in your OpacMainUserBlock by using <div> tags with classes that add up to 12.

3 columns on an OPAC

For example this code will generate 3 columns like in the image above.

<div class="row-fluid">
<div class="span4"><p>Column 1</p></div>
<div class="span4"><p>Column 2</p></div>
<div class="span4"><p>Column 3</p></div>
</div>

When viewed on a mobile device though it will organize so that the “columns” become “rows” and display in a more friendly fashion.

3 columns on a mobile OPAC

Check out these other examples:

2 Column Layout

<div class="row-fluid">
<div class="span6"><p>Column 1</p></div>
<div class="span6"><p>Column 2</p></div>
</div>

4 Column Layout

<div class="row-fluid">
<div class="span3"><p>Column 1</p></div>
<div class="span3"><p>Column 2</p></div>
<div class="span3"><p>Column 3</p></div>
<div class="span3"><p>Column 4</p></div>
</div>

Thanks to Owen Leonard for teaching me this awesome trick!


Leave a comment

Your email address will not be published. Required fields are marked *

Are you human? * Time limit is exhausted. Please reload CAPTCHA.

One thought on “Multiple Columns in Koha’s Bootstrap Theme