Home  >  Q&A  >  body text

html5 - How to set the percentage display of el-table-column in ElementUI table.

Introducing elementui table template,
<p class="content">

      <el-table :data="tableData" style="width: 100%;" stripe border>
          <el-table-column prop="title" label="申诉" width="100%" class="con-tableTitle">
              <el-table-column prop="date" label="日期" width="15%"></el-table-column>
              <el-table-column prop="name" label="姓名" width="5%"></el-table-column>
              <el-table-column prop="id" label="身份证" width="15%"></el-table-column>
              <el-table-column prop="hospital" label="医院" width="15%"></el-table-column>
              <el-table-column prop="cash" label="金额" width="8%"></el-table-column>
              <el-table-column prop="state" label="审核状态" width="7%"></el-table-column>
              <el-table-column prop="suggest" label="审核意见" width="25%"></el-table-column>
              <el-table-column label="操作" width="10%">
                  <template scope="scope">   
                    <el-button size="small" type="primary" @click="unappeal(scope.$index, scope.row)">提交</el-button>
                  </template>
              </el-table-column>
          </el-table-column>
      </el-table>
  </p> 
  
 代码部分el-table-column 宽度用百分比写的  ,然后不能按照百分比撑开,同时style会受到scoped限制,文档里面写的是具体值,想问下怎么样能够自定义百分比宽度?
黄舟黄舟2728 days ago3062

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-05-24 11:38:14

    You can try class-nameattributes, customize a class name, and then write css to add styles

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-24 11:38:14

    Look at the documentation and find a way to replace width with min-width, which will support percentage display!

    reply
    0
  • Cancelreply