使用jquery mobile的响应表

时间:2013-11-01 12:08:43

标签: jquery html css jquery-mobile responsive-design

当屏幕宽度变小时,我有3张桌子必须位于彼此之下。通常我会在每个表的周围容器上使用float: left;,但这不起作用。它将破坏我的jquery移动布局。

我以为我会制作一个小grid layout然后,但是会折叠我的桌子而不是将它们放在彼此之下。

当屏幕宽度减小时,如何在不使用浮点数的情况下将3个表格放在彼此之下,并且不会破坏jquery移动布局?

以下是我的页面布局示例:

<body class="container">
    <div data-role="page" data-theme="a">
        <div data-role="header" data-position="inline">
            <h1>Title</h1>
        </div>
        <div data-role="content" data-theme="a">
            <div data-demo-html="true">         
                <div data-role="collapsible-set" data-theme="a" data-content-theme="d" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d">
                    <div data-role="collapsible" data-collapsed="false">
                    </div>
                    <div data-role="collapsible">
                        <h3>Title</h3>
                        <div class="ui-grid-b">
                            <div class="ui-block-a">
                                <form class="form-search">
                                    <div class="content">
                                        <h3>Title</h3>
                                        <table class="center alfabet">
                                            <tr>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </div>
                                </form>
                            </div>
                            <div class="ui-block-b">
                                <form class="form-search">
                                    <div class="content">
                                        <table class="center alfabet">
                                            <tr>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </div>
                                </form>
                            </div>
                            <div class="ui-block-c">
                                <form class="form-search">
                                    <div class="content">
                                        <table class="center alfabet">
                                            <tr>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div data-role="collapsible">                   
                </div>
            </div>
        </div>
    </div>
</body>

1 个答案:

答案 0 :(得分:0)

Bootstrap Fluid Grid system

解决了这个问题
.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;}
.row-fluid:after{clear:both;}
.row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;}
.row-fluid [class*="span"]:first-child{margin-left:0;}
.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%;}


<div class="row-fluid">
     <div class="span4">
          Table 1 here
     </div>
     <div class="span4">
          Table 2 here
     </div>
     <div class="span4">
          Table 3 here
     </div>
</div>