List Dividers

A list divider can be used as a heading for a group of list items. For instance, if our app has a calendar listing, we may choose to group our calendar events by day (see Figure 5–4). List dividers can also be used as headers for inset lists. In our prior example, we also set the header of our inset list with a list divider (see Figure 5–2 and Listing 5–2).

To create a list divider, add the data-role="list-divider" attribute to any list item. The list divider's default text will appear left-aligned.

TIP: In Figure 5–4, the list items contain both left-aligned and right-aligned text. To position text right-aligned, wrap it with an element that contains a class of ui-li-aside (see Listing 5–3).

By default, list dividers will be ...

Get Pro jQuery Mobile now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.