Two-Column Grid

Description

A two-column (50%, 50%) grid is created in the following code.

The outer grid is configured with the CSS grid attribute of ui-grid-a. Next, we add two internal blocks. The first block is assigned a CSS value of ui-block-a and the second column is assigned a CSS value of ui-block-b.

Example


<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, maximum-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><!--  ww w . j  av a2 s.  c  o  m-->
<body>

  <div data-role="page" id="home">
    <div data-role="header">
      <h1>2-Column Grid</h1>
    </div>

    <div data-role="content">
      <div class="ui-grid-a">
        <div class="ui-block-a">
          <strong>Block A</strong><br>The text will wrap within the
          grid.
        </div>
        <div class="ui-block-b">
          <strong>Block B</strong><br>More text.
        </div>
      </div>
    </div>
  </div>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme