简体   繁体   English

jQuery Mobile用户界面响应表添加了额外的标题

[英]jQuery Mobile ui-responsive table adding extra header

Using jQuery Mobile - and the new ui-responsive class for a table - the table is supposed to collapse into a single column if the viewport becomes too narrow. 使用jQuery Mobile-以及表的新ui响应类-如果视口变得太窄,则该表应折叠为单列。

However - when I drag the browser to make the viewport smaller, it takes the first column heading, and adds it to the table footer: 但是,当我拖动浏览器以缩小视口时,它将采用第一列标题,并将其添加到表格页脚中:

Viewport wide enough: 视口足够宽:

之前

Narrow Viewport: 狭窄的视口:

后

My HTML markup is: 我的HTML标记是:

        <table data-role="table" class="ui-responsive">
        <thead>
            <tr class="ui-bar-b">
                <th>Column Header 1</th>
                <th>Column Header 2</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <select></select>
                </td>
                <td>
                    <select></select>
                </td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="2" style="text-align:center;">
                    <button data-icon="plus">Add</button>
                </td>
            </tr>
        </tfoot>
    </table>

I've added a demo to jsFiddle here: http://jsfiddle.net/mtait/44k3E/2/ 我在这里向jsFiddle添加了一个演示: http : //jsfiddle.net/mtait/44k3E/2/

Is this just a bug in the Mobile CSS - or is it known, and is there a work around? 这只是Mobile CSS中的错误-还是已知的,是否可以解决?

Thank you, 谢谢,

Mark 标记

It is not adding extra header. 它没有添加额外的标题。 This is the way in which it works. 这就是它的工作方式。 It will put the heading above each column values when its width reduces. 宽度减小时,它将标题放在每列值的上方。

For better understanding refer to the updated fiddle link. 为了更好地理解,请参考更新的小提琴链接。 DEMO DEMO

    <table data-role="table" class="ui-responsive">
        <thead>
            <tr class="ui-bar-b">
                <th>Column Header 1</th>
                <th>Column Header 2</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <select></select>
                </td>
                <td>
                    <select></select>
                </td>
            </tr>
            <tr>
                <td>
                    <select></select>
                </td>
                <td>
                    <select></select>
                </td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td>
                    <button data-icon="plus">Add</button>
                </td>
                 <td>
                    <button data-icon="plus">Add</button>
                </td>
            </tr>
        </tfoot>
    </table>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM