Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Mobile - input field across two columns in a three-column ui-grid layout?

How can I add an input text field across two columns in a three-column ui-grid layout (33/33/33%)?

The goal is that the input text field takes 66% and the third column occupies the rest.

Example ui-grid from jquery mobile:

<div class="ui-grid-b">
<div class="ui-block-a">Block A</div>
<div class="ui-block-b">Block B</div>
<div class="ui-block-c">Block C</div>
</div><!-- /grid-a -->
like image 445
Michael Schmidt Avatar asked Apr 12 '11 22:04

Michael Schmidt


2 Answers

simply overwrite the width property:

.ui-grid-a .ui-block-a { width: 65% }
.ui-grid-a .ui-block-b { width: 35%; } 

http://forum.jquery.com/topic/unequal-layout-grids-columns-or-colspan-like-behavior

like image 51
Michael Schmidt Avatar answered Nov 15 '22 11:11

Michael Schmidt


You could use:

<div class="ui-grid-b">
  <div class="ui-block-a ui-block-span2">
    Block A+B
  </div>
  <div class="ui-block-c">
    Block C
  </div>
</div>

You need to add the CSS below to achieve this. This could be used with any jqm grid layout simply adding the class ui-block-span* the your div blocks.

.ui-grid-b > .ui-block-span2 {
  width: 66.6666%;
}
.ui-grid-c > .ui-block-span2 {
  width: 50%;
}
.ui-grid-c > .ui-block-span3 {
  width: 75%;
}
.ui-grid-d > .ui-block-span2 {
  width: 40%;
}
.ui-grid-d > .ui-block-span3 {
  width: 60%;
}
.ui-grid-d > .ui-block-span4 {
  width: 80%;
}
like image 1
Douglas Lise Avatar answered Nov 15 '22 10:11

Douglas Lise