解決element-ui的table表格控件表頭與內容列不對齊問題
更新時間:2022年07月29日 10:26:35 作者:wwf1225
這篇文章主要介紹了解決element-ui的table表格控件表頭與內容列不對齊問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
element-ui的table表格控件表頭與內容列不對齊
解決方法
將以下樣式代碼添加到index.html、或app.vue中(必須是入口文件,起全局作用?。?/p>
body .el-table th.gutter{ display: table-cell!important; }
例如(app.vue):
<template> ? <div id="app"> ? ? <router-view></router-view> ? </div> </template>
<script> ? export default{ ? ? ?name: 'APP' ? } </script>
<style> ? /* 解決element-ui的table表格控件表頭與內容列不對齊問題 */ ? .el-table th.gutter{ ? ? display: table-cell!important; ? } </style>
<style lang="scss"> ? @import './styles/index.scss'; // 全局自定義的css樣式 </style>
el-table表頭和表格列寬不一樣問題
直接上圖
解決辦法
1.網上找的辦法
將以下樣式代碼添加到index.html、或app.vue中(必須是入口文件,起全局作用?。?/p>
body .el-table th.gutter{ display: table-cell!important; }
2.自己新建css文件common.css,在文件中將上面樣式寫入
/* 解決element-ui的table表格控件表頭與內容列不對齊問題 */ body .el-table th.gutter{ display: table-cell!important; }
3.在main.js文件中引入common.css文件
import '@/style/common.css'
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
您可能感興趣的文章:
相關文章
Vue路由this.route.push跳轉頁面不刷新的解決方案
這篇文章主要介紹了Vue路由this.route.push跳轉頁面不刷新的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-07-07在vue中v-for循環(huán)遍歷圖片不顯示錯誤的解決方案
這篇文章主要介紹了在vue中v-for循環(huán)遍歷圖片不顯示錯誤的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-01-01