1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Angular:Ng-zorro组件Table(嵌套子表格)样式修改笔记

Angular:Ng-zorro组件Table(嵌套子表格)样式修改笔记

时间:2022-07-15 14:56:32

相关推荐

Angular:Ng-zorro组件Table(嵌套子表格)样式修改笔记

Ng-zorro的Table(嵌套子表格)样式修改笔记

复杂点:展开按钮样式的修改,图例如下

修改为

点击按钮由加号换为箭头,实现方式为,用icon覆盖原来的加号,但保留原有加号的点击区域,html该表格区域相关代码:

<td [(nzExpand)]="data.expand"><d *ngIf="!data.expand" class="downicon"><i nz-icon nzType="right" nzTheme="outline"></i></d><d *ngIf="data.expand" class="downicon"><i nz-icon nzType="down" nzTheme="outline"></i></d></td>

样式(/deep/是修改ng-zorro组件样式的一种方式):

/* 主表样式,基于table样式的调整 */.parentTable /deep/ td.nz-disable-td.ant-table-cell {border-top: none !important;}/* 子表样式 */.childTable .ant-table-tbody>tr>td {color: #ffffff;background-color: #19292B ;}.childTable /deep/ .ant-table-tbody>tr.ant-table-placeholder {display: none !important;}/* childre表格位置 */.table /deep/ .ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table {margin: -5px -6px 0px -5px;}/* 小图标样式 */.downicon {position: absolute;top: 19%;cursor: pointer;left: 48%;}.table /deep/ .ant-table-row-expand-icon::before {top: 6px;right: 3px;left: 3px;height: 2px;}.table /deep/.ant-table-row-expand-icon::after {top: 2px;bottom: 1px;left: 6px;width: 1px;}.table /deep/ .ant-table-row-indent+.ant-table-row-expand-icon {width: 100%;margin: 0% 0 1% 8%;background-color: transparent;color: transparent;z-index: 999;}.table /deep/ .ant-table-row-expand-icon {width: 15px;height: 15px;line-height: 15px;border: 1px solid #203033;}.table /deep/ .ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover {color: transparent;}.table /deep/ .ant-table-row-expand-icon:active {color: transparent;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。