当前位置:   article > 正文

页面布局-表格自适应_jsp中使表格适应页面的方法

jsp中使表格适应页面的方法

很多时候我们做一个表格页面,页面需要自适应,也就是一屏展示,也就是表格的高度不能写死,需要铺满剩余页面高度.

<template>
  <div class="page_component">
    <!-- 查询条件 -->
    <div class="top">
 
    </div>
    <!-- 表格 -->
    <div class="table_box">
      <el-table 
        height="100%"
        border
        :header-cell-style="{ background: '#f5f5f5', color: '#333' }"
        :data="dataList"
      >
        <el-table-column
          prop="area"
          label="地区" 
          align="center"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="school"
          width="175"
          label="学校"
          align="center"
          show-overflow-tooltip
        >
        </el-table-column>
      </el-table> 
    </div>
   <!-- 分页控件 -->
    <el-col :span="24" class="pagination-box">
      <el-pagination
        @current-change="(val) => getTable(val)"
        @size-change="handleSizeChange"
        :current-page="paginations.page"
        :page-size="paginations.pageSize"
        layout="total, sizes, prev, pager, next, jumper" 
        :total="paginations.total_count"
        align="center"
      >
      </el-pagination>
    </el-col>
  </div>
</template>

<script> 
export default {  
 data() {
    return { 
    
 	}
  },
};
</script>

<style lang="scss" scoped>
.page_component{
	height:100%;
	width:100%;
	display: flex;
	flex-direction: column; 
	padding: 15px 20px;
}

.page_component .table_box {
  flex: 1;
  position: relative;   
}
.page_component .table_box>.el-table {
  position: absolute;
}
</style>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/724714
推荐阅读
相关标签
  

闽ICP备14008679号