全局针对el-table 中的el-table-column边框加粗
时间: 2024-09-14 22:16:07 浏览: 74
如果你想在Element UI的`el-table`组件中让所有的列边框加粗,你可以通过修改全局样式或者使用 scoped 模式来自定义单元格的样式。以下是两种常见的方式:
1. **全局样式**:
如果你希望对所有页面的`el-table-column`都生效,可以在CSS文件中添加如下的规则:
```css
.el-table-column {
border-width: 2px; /* 可以调整宽度 */
border-style: solid;
border-color: your-desired-color; /* 设置边框颜色 */
}
```
2. **Scoped样式** (如果你使用的是Vue.js):
在`.vue`组件的`<style>`标签内,使用`:is`选择器来限制样式只作用于`el-table-column`元素:
```html
<template>
<el-table :columns="columns">
<!-- ... -->
</el-table>
</template>
<style scoped>
el-table-column {
border-width: 2px;
border-style: solid;
border-color: your-desired-color;
}
</style>
```
记得替换`your-desired-color`为你想要的边框颜色。
阅读全文
相关推荐


















