我正在创建一个 ngx-datatable,但在表的标题处获得了额外的空间。此外,由于仅此标题,数据行未与标题对齐。这个额外的空间来自表的两端。
HTML:
<ngx-datatable class='bootstrap' columnMode="force" [headerHeight]="30" [selectionType]="'multiClick'"
[rows]="rows">
<ngx-datatable-column name="UserName" prop = "UserName" headerClass="mydata-table-header">
</ngx-datatable-column>
<ngx-datatable-column name="Date" prop = "Date" headerClass="mydata-table-header" >
</ngx-datatable-column>
<ngx-datatable-column name="Activity" prop="Activity" headerClass="mydata-table-header" ></ngx-datatable-column>
<ngx-datatable-column name="Decision" prop="Activity" headerClass="mydata-table-header" >
</ngx-datatable-column>
<ngx-datatable-column name="Remark" prop="Activity" headerClass="mydata-table-header">
</ngx-datatable-column>
CSS:
.ngx-datatable.bootstrap {
box-shadow: none;
font-size: 13px;
border:none;
border-collapse: collapse;
}
.ngx-datatable.bootstrap .datatable-header {
height: unset !important;
background-color:#28998b;
}
.ngx-datatable.bootstrap .datatable-header .datatable-header-cell {
vertical-align: bottom;
padding: 0.75rem;
border-bottom: 1px solid #000000;
border-left: 1px solid #000;
border-right: 1px solid #000;
}
.ngx-datatable.bootstrap .datatable-header .datatable-header-cell .datatable-header-cell-label {
line-height: 24px;
}
.ngx-datatable.bootstrap .datatable-body {
}
.ngx-datatable.bootstrap .datatable-body .datatable-body-row {
vertical-align: top;
border-top: 1px solid #000000;
}
.ngx-datatable.bootstrap .datatable-body .datatable-body-row.datatable-row-even {
background-color: rgba(0, 0, 0, 0.05);
}
.ngx-datatable.bootstrap .datatable-body .datatable-body-row .datatable-body-cell {
text-align: left;
vertical-align: top;
border-left: 1px solid #000;
border-right: 1px solid #000;
}
.ngx-datatable.bootstrap .datatable-body .datatable-body-row.active {
background-color: #1483ff;
color: #FFF;
}