简体   繁体   English

带表的自举网格系统

[英]Bootstrap grid system with table

I'd like to have table like this: 我想要这样的桌子:

在此处输入图片说明

And I'm trying to do this with bootstrap grid system, but it doesn't work...here is my code. 我正在尝试使用引导网格系统来执行此操作,但是它不起作用...这是我的代码。 Maybe the problem is with class container? 也许问题出在类容器上? It is correct to put div there? 将div放在那里是正确的吗?

<table class="table table-bordered" cellpadding="0" cellspacing="0">
<div class="container">
    <tr>
        <th class="col-sx-6">Avanced Time targetting</th>
        <th class="col-xs-1">Midnight<br/>12am</th>
        <th class="col-xs-1">4am</th>
        <th class="col-xs-1">8am</th>
        <th class="col-xs-1">Noon<br/>12pm</th>
        <th class="col-xs-1">4pm</th>
        <th class="col-xs-1">8pm</th>
    </tr>
    <tr>
        <td class="col-sx-6">
            <span>Monday</span>
            <ul>
                <li>
                    <button>All days</button>
                </li>
                <li>
                    <button>Morning</button>
                </li>
                <li>
                    <button>9-5</button>
                </li>
                <li>
                    <button>Evening</button>
                </li>
                <li>
                    <button>Custom</button>
                </li>
                <li>
                    <button>Clear</button>
                </li>
                <li>
                    <button>Restore</button>
                </li>
            </ul>
        </td>
        <td class="col-xs-1">
            <input type="text"/>
        </td>
        <td class="col-xs-1">
            <input type="text"/>
        </td>
        <td class="col-xs-1">
            <input type="text"/>
        </td>
        <td class="col-xs-1">
            <input type="text"/>
        </td>
        <td class="col-xs-1">
            <input type="text"/>
        </td>
        <td class="col-xs-1">
            <input type="text"/>
        </td>
    </tr>
</div>

Your HTML code is correct but you need to put the container div before the table. 您的HTML代码是正确的,但是您需要将容器 div放在表之前。

Here is some of basic understanding about bootstrap grid system . 这是有关引导网格系统的一些基本理解。

The container div must be outside the table in order for it to align correctly. 容器div必须在表的外部才能正确对齐 Furthermore, the structure of your table will align perfectly when you use the theader , tbody and tfooter tags in your table along with the th/td tags . 此外,当您在表中使用theadertbodytfooter标记以及th / td 标记时,表的结构将完美对齐。

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

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