<el-table
:data="tableData"
border
class="table"
:cell-style="cellStyle"
:header-cell-style="headerCellStyle">
<el-table-column prop="num1" label="高低潮" header-align="center" align="center" />
</el-table>
<script setup>
const cellStyle = {
background: 'transparent', //这个是取消鼠标滑过显示颜色看自己需求
borderColor: '#205978'
}
const headerCellStyle = {
background: 'rgba(24, 102, 143, 0.3)', //表头背景色设置
borderColor: '#205978'
}
</script>
<style lang="less" scoped>
.table {
margin-top: 30px;
border: 1px solid #205978; //设置表格外边框
display: flex; //解决表格宽度无限延伸
flex: 1; //解决表格宽度无限延伸
}
</style>
最终效果