固定表头的table
2024-09-01 20:01:15
在前端的开发过程中,表格时经常使用的一种展现形式。在我的开发过程中,当数据过多时,最常用的一种方式就是分页,但是有些地方还是需要滚动。通常的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:;
}
最新文章
- Debian8.3如何设置默认不启动Gnome
- SQL Server 2005中的CTE递归查询得到一棵树
- jQuery立体式数字滚动条增加
- Mecanim 动作复用示例
- 在Eclipse中自定义类似syso的快捷代码模板
- var wi = 0; wi <; arr.length; wi++
- 夺命雷公狗---node.js---22之项目的构建在node+express+mongo的博客项目7之数据的修改
- 蓝牙SIG
- Hadoop项目开发环境搭建(Eclipse\MyEclipse + Maven)
- HDU1284钱币兑换问题( 母函数打表)
- DataTable和DataSet有什么区别
- 使用 Passenger +Apache扩展 Puppet,代替其Webrick的web框架
- Python输入一个数字打印等腰三角形
- 第一周 动态规划Dynamic Programming(一)
- &#39;gbk&#39; codec can&#39;t encode character解决方法
- AIX X11卡顿严重
- NGINX+PHP+ZABBIX,推荐
- python -- 进程线程协程专题
- 12306微信小程序上线 提供余票查询暂不支持购票
- Orchard之生成新模板