关于elementui表格错位问题小记

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/wow_scott/article/details/101107403

网上说的最多的方法

body .el-table th.gutter{
	    display: table-cell!important;
	}
	 
	body .el-table colgroup.gutter{
	    display: table-cell!important;
	}

注意:该方法需要写在入口文件进行全局设置。例如,App.vue

第二种方法

引用——iYiu博主: https://blog.csdn.net/Jensen_Yao/article/details/88538971

 .el-table__body{ 
 	overflow: hidden !important;
 }

或者

table {
	overflow: hidden !important;
}

第三种方法

上面两种都没有解决我的问题,这种能暂时解决,不清楚有没有其他问题

.el-table--border th.gutter:last-of-type{
  	display: table-cell !important; 
  	width:50px !important; 
 }

宽度值的大小没有详细测试过,但是如果太小没有效果,设置过大就不清楚有没有其他影响了。
该方法只是暂时解决我的问题,后面有时间会在仔细研究下

如有问题留言交流,第三种方法有问题记得提醒更正【手动滑稽】

猜你喜欢

转载自blog.csdn.net/wow_scott/article/details/101107403