O'Reilly logo

Pro jQuery Mobile by Brad Broulik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required