1.以“发起时间”为例,实现效果如下
(1)修改前
(2)修改后
2.代码
主要使用cell-style参数,具体代码:
<el-table
v-loading="loading"
height="535"
:cell-style="createTimeStyle"
>
<el-table-column
label="发起时间"
align="right"
prop="createTime"
width="200"
:formatter="pdateFormat"
class-name="time"
/>
</el-table>
methods: {
// 日期格式化
pdateFormat(row, column) {
if (row.createTime) {
return row.createTime.slice(0, 10);
}
},
createTimeStyle(column) {
//第7列
if(column.columnIndex == 7) {
return "padding-right: 60px"
}
},
}
<style coped>
.el-table th.el-table__cell.time > .cell{
padding-right: 70px;
}
</style>