减少JQuery mobile中GridView的填充

时间:2013-06-12 07:14:02

标签: jquery-mobile padding cellpadding

我有一个表,每行有4列,我想占据行中所有空间的列,并没有这么大的余量。该怎么办? 我得到的结果是:

enter image description here

这是代码:

  <body>

    <div data-role="page" class="type-interior">

    <div data-role="header" data-theme="f">
    <h1>Search</h1>
    <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
    <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
</div><!-- /header -->

<div data-role="content">
    <div class="content-primary">   
        <ul data-role="listview" data-filter="true">
            <li><a href="index.html">
                <div data-role="content"> <div class="ui-grid-c">
                    <div class="ui-block-a">
                        <div class="ui-bar ui-bar-e" >Block A</div>
                    </div>
                    <div class="ui-block-b">
                        <div class="ui-bar ui-bar-e" >Block B</div> 
                    </div>
                    <div class="ui-block-c">
                        <div class="ui-bar ui-bar-e" >Block C</div>
                    </div>
                    <div class="ui-block-d">
                        <div class="ui-bar ui-bar-e" >Block D</div>
                    </div>
                </div>
            </div>
            </a></li>
            <li><a href="index.html">
            <div data-role="content"> <div class="ui-grid-c">
                    <div class="ui-block-a">
                        <div class="ui-bar ui-bar-e" >Block 1</div>
                    </div>
                        <div class="ui-block-b">
                        <div class="ui-bar ui-bar-e" ">Block 2</div> 
                    </div>
                    <div class="ui-block-c">
                        <div class="ui-bar ui-bar-e" >Block 3</div>
                    </div>
                    <div class="ui-block-d">
                        <div class="ui-bar ui-bar-e" >Block 4</div>
                    </div>
                </div>
            </div>

1 个答案:

答案 0 :(得分:0)

我将Block的类从 ui-bar ui-bar-e 更改为 ui-bar ui-bar

   <div data-role="content">

        <ul data-role="listview" data-filter="true" data-theme="e"  >
            <li><a href="index.html">

                <div data-role=""> <div class="ui-grid-c"  >

                    <div class="ui-block-a" >

                    <div class="ui-bar ui-bar" >Block A</div>
                   </div>
                    <div class="ui-block-b">
                        <div class="ui-bar ui-bar" >Block B</div> 

                    </div>
                    <div class="ui-block-c">
                        <div class="ui-bar ui-bar" >Block C</div> 
                    </div>
                    <div class="ui-block-d">
                        <div class="ui-bar ui-bar" >Block D</div>
                    </div>
                </div>
            </div>
            </a></li>
            <li><a href="index.html">
            <div data-role=""> <div class="ui-grid-c">
                    <div class="ui-block-a">
                        <div class="ui-bar ui-bar" >Block 1</div>
                    </div>
                        <div class="ui-block-b">
                        <div class="ui-bar ui-bar" ">Block 2</div> 
                    </div>
                    <div class="ui-block-c">
                        <div class="ui-bar ui-bar" >Block 3</div>
                    </div>
                    <div class="ui-block-d">
                        <div class="ui-bar ui-bar" >Block 4</div>
                    </div>
                </div>
            </div>

我删除了 div class =“content-primary”

为了获得黄色背景我用 data-theme =“e”

更改了主题