Styling the collection view in Tabris.js

One of the most common mobile views for displaying information is the collection view. The collection view is a scrollable list often used for presenting data as a series of rows and has been part of Tabris.js since the beginning. Previously Tabris.js required that all rows be styled the same, but with Tabris.js 1.1 you can now style each item separately.

Collection views are styled using the initializeCell function. In this example, we style Section Headers with 18px bold font, and all other cells with 14px font. We also set a different background colour for section headers too.


The type of the cell is published by implementing the cellType function. Finally, the height of the item can be set by implementing the itemHeight function.


The complete example can be found on or in our tabris.js GitHub repository.

For more Tabris.js Tips and Tricks, follow us on Twitter.