Vue.js table表格添加横向滚动条

只需要在最后一列指定列宽即可。比如下面最后一列是“操作”列,加上 width="200",即会在表格宽度大于浏览器页面宽度时显示横向滚动条了

<el-table ref="multipleTable" v-loading="loading" :data="taskList">
      <el-table-column type="selection" width="50" align="left" />
      <el-table-column label="任务编号" width="60" align="left"  prop="id" ></el-table-column>
      <el-table-column label="素材类型" width="60" align="left"  prop="status">
        <template slot-scope="scope">
          <p v-if="scope.row.status==0">success</p>
          <p v-else-if="scope.row.status==1">fail</p>
          <p v-else>未知</p>
        </template>
      </el-table-column>
      <el-table-column label="其他" width="100" align="left" prop="detail" :show-overflow-tooltip="true" />
      </el-table-column>
      <el-table-column label="创建时间" align="left" prop="create_time_str" width="160"></el-table-column>
      <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="200">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-detail" @click="handleShowTaskDetail(scope.row)">任务详情</el-button>
        </template>
      </el-table-column>
    </el-table>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值