繁体   English   中英

用边框css填充表空行

[英]filling up a table empty rows with a border css

因此,我为表指定了区域,有时从数据库读取数据后,表并没有完全填充到该区域的底部。 对于空白空间,我希望周围有一个边框连接到表格,因此它看起来好像表格一直到底部,但是剩余的空间只是边框所包围的一个很大的空白空间(看起来像是它的一部分)的桌子)

有关如何操作的任何提示? 宁愿只使用CSS

码:

    <div class="col-md-11" style="width:86%">
        <div class="table-responsive user-table" style="overflow-y:auto; overflow-x:hidden">
            <table class="table table-striped table-bordered" id="table_{{table.name}}">
                <thead>
                    <tr>
                        <th ng-repeat="header in table.headers track by $index" style="background-color: #0D3C47; color:white">
                            <div data-ng-if="header.type !== 'checkbox'">{{header}}</div>
                            <div data-ng-if="header.type === 'checkbox'">{{header.value}}</div>
                        </th>

                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="row in table.rows track by $index">
                        @*<tr ng-repeat="row in table.rows | activeOrNot: table.checkboxCol: table.filterIsEnabled track by $index">*@

                        <td ng-repeat="item in row | filter: {type: '!GUID'} track by $index "
                            ng-click="table.selectedRow(row)"
                            ng-class="{ 'highlight' : row === table.selected}">

                            <div data-ng-if="item.type === undefined">{{item}}</div>
                            <div data-ng-if="item.type === 'checkbox'">
                                <input type="checkbox" ng-checked="item.checked" ng-disabled="true">
                            </div>
                            <div data-ng-if="item.type === 'GUID'">
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th class="text-right" style="padding-right: 30px; font-size: 15px">
                        <div>Showing result {{table.entries.displayingAmount}} of {{table.entries.totalAmount}}</div>
                    </th>

                </tr>
            </thead>
        </table>

    </div>

这是引导程序。 唯一的CSS样式是类user-tableheight: 720

代码功能以及我想要的外观的图片: https : //awwapp.com/s/c7447569-50a4-49a7-805b-43eb0770985f/

您应该添加一些不同的类和Div作为新容器

这是您的完整代码: http : //codepen.io/mhadaily/pen/PzAPEW

澄清:

您的课程必须有左右边框

.user-table{
  height: 720px; 
  border-right:1px solid #ddd;
  border-left:1px solid #ddd;
  padding: 0px;
  border-top:0px;
  border-bottom:0px;
}

并且您还需要向第一个表添加一个新类以删除多余的边框,例如我将我的类命名为no-bottom

<table class="table table-striped table-bordered no-bottom" id="table_{{table.name}}">

尝试在css中删除边框,随意修改

.table-bordered.no-bottom{
  margin-bottom:0px;
  border-right:0px;
  border-left:0px;
}

然后您现在可能还需要在下面的类中更改边框:

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ }

请记住,您应该将自定义类添加到上面的类中,以避免全局更改。

而已。 你有你想要的。 您可以在这里查看结果http://codepen.io/mhadaily/pen/PzAPEW

暂无
暂无

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

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