在HTML中创建带滚动条的table
来源:互联网 发布:桐乡淘宝打包 编辑:程序博客网 时间:2024/05/11 06:35
<div style="float:left;width:100%;">
<table class="life-table" style="border:4px solid #E78F28;" cellspacing="0">
<thead>
<tr>
<th class="life-title" width="35px"></th>
<th class="life-title" width="150px">9/2 周三</th>
<th class="life-title" width="150px">9/3 周四</th>
<th class="life-title" width="150px">9/4 周五</th>
<th class="life-title" width="13px"></th>
</tr>
</thead>
<tbody style="overflow-y:scroll;overflow-x:hidden;height:100px;">
<tr>
<td class="life-title" height="22px">00:00</td>
<td align="center" style="background:red;color:white;">浏览网页</td>
<td align="center" style="background:yellow;">看书</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">01:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">coding</td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">02:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:blue;color:white;">学英语</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">03:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">数据库</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">00:00</td>
<td align="center" style="background:red;color:white;">浏览网页</td>
<td align="center" style="background:yellow;">看书</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">01:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">coding</td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">02:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:blue;color:white;">学英语</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">03:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">数据库</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
</tbody>
</table>
</div>
评:上述代码在Firefox里能work,但是在IE8不行。下面的代码使用两个表格,在Firefox和IE8中均正常。使用两个表格的缺点是,不容易将表头和内容对齐
<div style="float:left;width:100%;height:auto;">
<table class="life-table" cellspacing="0" cellpadding="0">
<tr>
<th class="life-title" width="35px"></th>
<th class="life-title" width="150px">9/2 周三</th>
<th class="life-title" width="150px">9/3 周四</th>
<th class="life-title" width="150px">9/4 周五</th>
<td class="life-title" width="15px"></td>
</tr>
<tr><td colspan="5">
<div style="overflow-y:scroll;height:100px;">
<table cellspacing="0">
<tr>
<td class="life-title" height="22px">00:00</td>
<td align="center" style="background:red;color:white;">浏览网页</td>
<td align="center" style="background:yellow;">看书</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">01:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">coding</td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">02:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:blue;color:white;">学英语</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">03:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">数据库</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">00:00</td>
<td align="center" style="background:red;color:white;">浏览网页</td>
<td align="center" style="background:yellow;">看书</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">01:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">coding</td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">02:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:blue;color:white;">学英语</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td class="life-title" width="15px" height="22px">03:00</td>
<td align="center" style="background:#DEECFF;"></td>
<td align="center" style="background:green;color:white;">数据库</td>
<td align="center" style="background:#DEECFF;"></td>
</tr>
<tr>
<td width="35px"></td>
<td width="150px"></td>
<td width="150px"></td>
<td width="150px"></td>
</tr>
</table>
</div>
</td></tr>
</table>
</div>
- 在HTML中创建带滚动条的table
- HTML中table带滚动条而标题栏不移动的做法
- 带滚动条的table
- jsp中实现带滚动条的table表格
- 带滚动条的table (ie only)
- 创建一个带滚动条的div
- 创建一个带滚动条的div
- html在文本框中加入滚动条
- 在lua中使用cocostudio创建的滚动条
- html中滚动条的样式
- HTML中滚动条的样式设置
- html中滚动条的监听
- 固定表头带滚动条的HTML表格
- 固定表头带滚动条的HTML表格
- 固定表头带滚动条的HTML表格
- VC2010 MFC多文档项目中在带滚动条的窗口中显示图像
- VC2010 MFC多文档项目中在带滚动条的窗口中显示图像
- [HTML]给Table添加滚动条
- vector的用法
- ubuntu下安装xdmcp服务
- Quartz实例
- serializable作用
- MyEclipse中直接打开class文件的方法
- 在HTML中创建带滚动条的table
- VS编辑器出现很多圆点或箭头的解决方法
- 下拉框和复选框关联
- 【搜贴】NucleusPLUS嵌入式操作系统。(目前Nucleus已到2.0版本,号称性能更好。不过要收钱。)
- 每天定时下载mp3并移动昨日旧文件
- POJ 1953 我爱递归 可是递归不爱我 再次TLE
- Apache + PHP + MySql 安装
- Sql Server 性能分析3 –数据库大小,数据库表大小综合性分析
- 3G的相关知识