elementUI中 讓表格中的數據 居中顯示

給你的 el-table 加上倆個屬性 cell-style header-cell-style

<el-table :cell-style="cellStyle" :header-cell-style="rowClass">
</el-table>

// 然後就是在方法中定義兩個方法
methods:{
	private cellStyle({row,column,rowIndex,columnIndex}:any){
	    return "text-align:center;"
	  }
	  private rowClass({row,rowIndex}:any){
	    return "text-align:center;"
	  }
}

刷新頁面就可以了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章