el-table change row height

el-table is a callback method for changing
the style of the row height row-style row, or you can use a fixed Object to set the same Style for all rows.
cell-style The callback method of the style of the cell, you can also use a fixed Object to set the same Style for all cells.
header-row-style The callback method of the style of the header row. You can also use a fixed Object to set the same Style for all header rows.
header-cell-style The callback method of the style of the header cell. You can also use a fixed Object to set the same Style for all header cells.

These four attributes are mainly related to the row height of the table row and table header.
Set the height in the row-related attribute to 0,
set the padding in the cell-related attribute to 0, remove the default padding: 8px 0 for the padding in the td,
and then use the depth selector to select the row label to set the height you want

table上设置
		:row-style="{height: '0'}"
        :cell-style="{padding: '0'}"
        :header-row-style="{height: '0'}"
        :header-cell-style="{padding: '0'}"cript

css
		::v-deep(.el-table__header) { //表头行高
		    tr {
		      height: 40px;  //设置高度 主要是这个
		    }
		    .cell {
		      display: inline-flex;
		      align-items: center;
		      justify-content: center;
		      height: 23px;
		      width: 100%;
    }

	 ::v-deep(.el-table__body) {
    	tr { 或这儿设试下
	      .cell {
	        width: 100%;
	        height: 30px;   //设置高度 主要是这个
	        line-height: 30px;
	        flex-wrap: nowrap;
	        overflow: hidden;
	        text-overflow: ellipsis;
	        white-space: nowrap;
	        justify-content: center;
	        align-items: center;
	      }
   	 }
  }

Guess you like

Origin blog.csdn.net/weixin_66029924/article/details/127417392