el-table单元格不自动换行

vue element UI el-table表格调整行高,及单元格内字体大小

说明:

缩小:行高到一定程度之后便不能缩小。 好像最小35px。各位可以试一下。

升高:本人实际开发中没试过最大多少,但行高的高度完全可以调到自己适合的高度。

 <el-table
    :row-style="{height:'20px'}"
    :cell-style="{padding:'0px'}"
    style="font-size: 10px">
 </el-table>

cell-style="padding:0"这列可以不用加。 这是我在缩小高度时,缩小到最小高度不能再缩时才加的。

show-overflow-tooltip

多出内容换行展示

<el-table-column label="特征二" align="center" prop="traitTwo" >
      <template scope="scope">
        <el-tooltip effect="dark" placement="top">
          <div class="content" slot="content" v-html="scope.row.traitTwo"></div>
          <div class="oneLine"> {
   
   {scope.row.traitTwo}}</div>
        </el-tooltip>
      </template>
      </el-table-column>


# css
.content {

  max-width: 300px

}
.oneLine {
  overflow: hidden;
  white-space: pre;
  text-overflow: ellipsis;
}

猜你喜欢

转载自blog.csdn.net/w710537643/article/details/128633852