【问题标题】:Responsive tables with jquery mobile带有 jquery mobile 的响应式表
【发布时间】:2013-11-04 15:55:01
【问题描述】:

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

我想我会做一个小的grid layout,但这会折叠我的表格,而不是把它们放在彼此下方。

如何在屏幕宽度减小、不使用浮动且不破坏 jquery 移动布局的情况下将 3 个表格置于彼此下方?

这是我的页面布局示例:

<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>

【问题讨论】:

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


    【解决方案1】:

    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>
    

    【讨论】:

      猜你喜欢
      • 2012-07-19
      • 2013-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-16
      • 1970-01-01
      • 2014-06-10
      相关资源
      最近更新 更多