Three-Column Grid

Description

A three-column (33%, 33%, 33%) grid is shown as follows.

Example

The CSS attribute for the grid is set to support three columns (ui-grid-b) and we have added an additional block for the third column (ui-block-c).

We also styled the blocks with themeable classes which can be added to any element including grids.


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
  href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head><!--from w ww  . ja  va2  s.co m-->
<body>
  <div data-role="page" id="home">
    <div data-role="header">
      <h1>3-Column Grid</h1>
    </div>
    <div data-role="content">
      <div class="ui-grid-b">
        <div class="ui-block-a">
          <div class="ui-bar ui-bar-e" style="height: 100px;">Block A</div>
        </div>
        <div class="ui-block-b">
          <div class="ui-bar ui-bar-e" style="height: 100px;">Block B</div>
        </div>
        <div class="ui-block-c">
          <div class="ui-bar ui-bar-e" style="height: 100px;">Block C</div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme