【无标题】element plus table表格的样式

在这里插入图片描述

//设置表头
::v-deep .el-table th.is-leaf {
	// border: none;
	background: #12437d !important;
	height: 60px !important;
	font-size: 20px;
	font-weight: 400;
	color: aliceblue;
	border: none !important;
}

//设置表格内容区域背景色为透明色
:deep(.el-table,
	.el-table__expanded-cell) {
	background-color: transparent;
	color: aliceblue;
	font-size: large;
	font-weight: 400;
}```

//鼠标移动到每行透明色
::v-deep .el-table__row:hover>td {
	background-color: transparent !important;
}

//去除table item每行的线
:deep(.el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf) {
		border-bottom: none !important;
	}

`//去除table最后一行的线
	:deep(.el-table__inner-wrapper::before) {
		background-color: transparent;
	}``

//给每行设置class类名
const tableRowClassName = ({ rowIndex }) => {
	if (rowIndex % 2 === 0) {
		return 'yellow'
	} else {
		return 'orange'
	}
}
const headerRowStyle = (args) => {
	return {
		height: '50px',
		backgroundColor: '#03102d'
	}
}
// 第二个弹框的table的每行颜色
:deep(.yellow) {
	background: transparent !important;
	height: 60px;
	// border-bottom: 1px solid transparent !important;
}

:deep(.orange) {
	height: 60px;
	background: #12437d !important;

}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PyQt5自带了一些表格样式,你可以使用这些样式来美化你的表格。这里给出一些常见的样式,你可以根据自己的需求进行选择和调整。 1. QTableWidget::item { padding: 5px; } 这个样式会给每个单元格添加一个5像素的内边距,让表格看起来更加整洁。 2. QTableWidget::item:selected { background-color: #90EE90; } 这个样式会在用户选中一个单元格时,将该单元格的背景色设置为#90EE90。 3. QHeaderView::section { background-color: #333; color: #FFF; padding: 5px; border: none; font-weight: bold; text-align: center; } 这个样式会设置表头的样式,将背景色设置为#333,文字颜色设置为白色,添加5像素的内边距,去除边框,加粗字体,并将文本居中对齐。 4. QTableView::horizontalHeader { background-color: #333; color: #FFF; } 这个样式会将水平表头的背景色设置为#333,文字颜色设置为白色。 5. QTableView::verticalHeader { background-color: #EEE; } 这个样式会将垂直表头的背景色设置为#EEE。 你可以通过在代码中添加这些样式来美化你的表格,例如: ```python tableWidget.setStyleSheet(""" QTableWidget::item { padding: 5px; } QTableWidget::item:selected { background-color: #90EE90; } QHeaderView::section { background-color: #333; color: #FFF; padding: 5px; border: none; font-weight: bold; text-align: center; } QTableView::horizontalHeader { background-color: #333; color: #FFF; } QTableView::verticalHeader { background-color: #EEE; } """) ``` 这样就可以实现一个比较好看的表格样式

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值