我正在开发一个jquery移动应用程序。在我的应用程序中,我有一些表格数据,我想水平布局。目前,我有以下内容:
<div data-role="content">
<ul data-role="listview">
<li data-role="list-divider">Information Here</li>
</ul><br />
<ul id="myList" data-role="listview" data-inset="true" data-theme="d" data-dividertheme="d">
<li data-role="list-divider">Choice</li>
<li data-role="fieldcontain">
<div class="ui-grid-c">
<div class="ui-block-a" style="font-weight:normal;">From</div>
<div class="ui-block-b">
<select name="selector1" id="selector"1 data-native-menu="false">
<option value="__">Please Choose</option>
</select>
</div>
<div class="ui-block-c" style="font-weight:normal;">To</div>
<div class="ui-block-d">
<select name="selector2" id="selector2" data-native-menu="false">
<option value="__">Please Choose</option>
</select>
</div>
</div>
</li>
</ul>
</div>
我的挑战是,网格方法均匀地划分了4列。实际上,我只想横向排列元素。我不需要所有东西均匀分布。但是,我不知道该怎么做。
如何横向布局内容?
答案 0 :(得分:1)
像这样:http://jsfiddle.net/Gajotres/K9duV/
<ul id="myList" data-role="listview" data-inset="true" data-theme="d" data-dividertheme="d">
<li data-role="list-divider">Choice</li>
<li>
<div class="ui-grid-a">
<div class="ui-block-a" style="font-weight:normal;">
<div data-role="fieldcontain" id="left-select">
<label for="selector1">From:</label>
<select name="selector1" id="selector1" data-native-menu="false">
<option value="__">Please Choose</option>
</select>
</div>
</div>
<div class="ui-block-b">
<div data-role="fieldcontain" id="right-select">
<label for="selector2">To:</label>
<select name="selector2" id="selector2" data-native-menu="false">
<option value="__">Please Choose</option>
</select>
<div>
</div>
</div>
</li>
</ul>