Grid Layouts

jQuery Mobile's grids are configurable to support layouts in the range of two to five columns. From an HTML perspective, grids are div elements that are configured with CSS attributes. The Grid is flexible and will consume the entire width of your display. The grids do not contain borders, padding, or margins so they will not interfere with the styles of elements contained within them. Before we look at an example let's review the standard grid template.

Grid Template

The grid template may be a helpful reference when creating multi-column grids (see Listing 6–1).

Listing 6–1. Grid Template

<div data-role="content">   <!-- Grid container -->   <div class="<grid-css-attribute>">     <!-- Blocks -->     <div class="<block-css-attribute ...

Get Pro jQuery Mobile now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.