html 表格实现

javascript 复制代码
<template>
  <div class="nox">
    <table class="hot-table" height='244'>
      <tr>
        <th v-for="(item, index) in headers" :key="index">{{item.label}}</th>
      </tr>
      <tr v-for="(item, index) in evaluationData.list" :key="index">
        <td>{{item.name}}</td>
        <td>{{item.value1}}</td>
        <td>{{item.value2}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  data () {
    return {
      headers: [
        { label: '名称', prop: 'key' },
        { label: '数量', prop: 'highRiskNum' },
        { label: '总价', prop: 'highRiskProportion', unit: '%' }
      ],
      evaluationData: {
        list: [
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' }
        ]
      }
    }
  }
}
</script>

<style lang="less" scoped>
.nox {
  background: #fff;
}
.hot-table {
  width: 300px;
  th {
    height: 20px;
    font-size: 12px;
    font-weight: normal;
    background: #edf0f5;
    padding-left: 20px;
    color: #404e73;
  }
  td {
    height: 20px;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid #f2f3f6;
  }
}
</style>
相关推荐
rising start10 分钟前
前端基础一、HTML5
前端·html·html5
Never_Satisfied18 分钟前
在JavaScript / HTML中,div容器在内容过多时不显示超出的部分
开发语言·javascript·html
鬼谷中妖19 分钟前
JavaScript 循环与对象:深入理解 for、for...in、for...of、不可枚举属性与可迭代对象
前端
大厂码农老A24 分钟前
你打的日志,正在拖垮你的系统:从P4小白到P7专家都是怎么打日志的?
java·前端·后端
im_AMBER25 分钟前
CSS 01【基础语法学习】
前端·css·笔记·学习
DokiDoki之父29 分钟前
前端速通—CSS篇
前端·css
pixle032 分钟前
Web大屏适配终极方案:vw/vh + flex + clamp() 完美组合
前端·大屏适配·vw/vh·clamp·终极方案·web大屏
ssf198738 分钟前
前后端分离项目前端页面开发远程调试代理解决跨域问题方法
前端
@PHARAOH38 分钟前
WHAT - 前端性能指标(加载性能指标)
前端
尘世中一位迷途小书童43 分钟前
🎨 SCSS 高级用法完全指南:从入门到精通
前端·css·开源