在前端的开发过程中,表格时经常使用的一种展现形式。在我的开发过程中,当数据过多时,最常用的一种方式就是分页,但是有些地方还是需要滚动。通常的table 会随着滚动,导致表头看不见。一下是我找到的一种固定表头的方法。代码如下:

div class="t_head">
<table class="table_style">
<caption class="tableTitle stateLegend">
<span class="epgDate l" v-html="epgDate"></span>
<span class="l">频道列表</span>
<ul>
<li v-for="(item,index) in programType" :key="index" @click="screenChannelList(item)">
<span class="legend"></span>
<span class="legendName"> {{item.type}}</span>
</li>
</ul>
</caption>
<thead>
<tr>
<th width="30%">编号</th>
<th width="30%">名称</th>
<th width="30%">出现位置</th>
<th width="10%">操作</th>
<th></th>
</tr>
</thead>
</table>
</div>
<div class="t_body scroll_live" v-if="isChannel">
<table class="table_style">
<tbody>
<tr v-for="(channel,index) in liveEpgList" :key="index" @click="getLookBackEpgList(channel.channelID,channel.channelName);"
class="trHover" :class="[index%2 ? 'TRlight' : 'TRdark',{'hidden' : channel.location == 2 && changeItem =='隐藏'},{'add':channel.changeType == 0},{'offline':channel.changeType == 1},{'trIsClick' : alreadyChooseNum == channel.channelID} ]">
<td width="30%" :title="channel.channelID">{{channel.channelID}}</td>
<td width="30%" :title="channel.channelName">{{channel.channelName}}</td>
<td width="30%" :title="channel.location ==2?'隐藏':'可见'" v-html="channel.location ==2?'隐藏':'可见'"></td>
<td width="10%"><div class="deal" @click.stop="dealChannelAbnormal(channel)">处理</div></td>
</tr>
</tbody>
</table>
</div>
.t_head {
width: 100%;
height: 71px;
} .t_body {
width: 100%;
height: calc(100% - 72px);
overflow-y: auto;
position: absolute;
top: 72px;
left:;
right:;
bottom:;
}

最新文章

  1. Debian8.3如何设置默认不启动Gnome
  2. SQL Server 2005中的CTE递归查询得到一棵树
  3. jQuery立体式数字滚动条增加
  4. Mecanim 动作复用示例
  5. 在Eclipse中自定义类似syso的快捷代码模板
  6. var wi = 0; wi &lt; arr.length; wi++
  7. 夺命雷公狗---node.js---22之项目的构建在node+express+mongo的博客项目7之数据的修改
  8. 蓝牙SIG
  9. Hadoop项目开发环境搭建(Eclipse\MyEclipse + Maven)
  10. HDU1284钱币兑换问题( 母函数打表)
  11. DataTable和DataSet有什么区别
  12. 使用 Passenger +Apache扩展 Puppet,代替其Webrick的web框架
  13. Python输入一个数字打印等腰三角形
  14. 第一周 动态规划Dynamic Programming(一)
  15. &#39;gbk&#39; codec can&#39;t encode character解决方法
  16. AIX X11卡顿严重
  17. NGINX+PHP+ZABBIX,推荐
  18. python -- 进程线程协程专题
  19. 12306微信小程序上线 提供余票查询暂不支持购票
  20. Orchard之生成新模板

热门文章

  1. java基本数据类型和包装类相互转换
  2. java引用变量类型转换
  3. Codeforces Round #183 (Div. 2)
  4. poj 3279(开关问题)(待完成)
  5. WPF 从零开始开发 dotnet Remoting 程序
  6. Flutter 添加阴影效果
  7. CSV 文件的存取
  8. $CF949D\ Curfew$ 二分/贪心
  9. $Noip2015/Luogu2661$ 信息传递 并查集
  10. SQL预处理