固定表头,两个表无法对齐,不管宽度什么改都没法弄,帮看看,,非常感谢。。。

ruky 2011-12-13 03:05:54
<html>
<head>
<style>
body{font-size:12px;}
.t_n{width:100px; heihgt:240px!important; height:242px; float:left; border-bottom:1px solid #ccc; border-left:1px solid #ccc}
.t_n span{display:block; text-align:center; line-height:20px; border:1px solid #ccc; width:97; height:46px}
.t_n span table{ width:97px; height:46px}
.tt {width:20px; height:auto; border-right:1px solid #ccc;}
.t_number{border-right:1px solid #ccc; width:100%; margin-bottom:5px}
.t_number td{border-bottom:1px solid #ccc; height:75px; width:70px; text-align:center}
.tt0{width:22px; height:auto; border-right:1px solid #ccc;}
.tt1{width:22px; height:auto; border-bottom:1px solid #ccc; border-right:1px solid #ccc;}
.tt2{height:75px; border-right:1px solid #ccc; border-bottom:1px solid #ccc;}
.dd{height:200px!important; height:208px; overflow-y:hidden;}
.t_i{width:900px; height:auto; float:left; border-right:1px solid #ccc; border-top:1px solid #ccc}
.t_i_h{width:100%; overflow-x:hidden; background:url("images/tbtop_03.gif");}
.ee{width:3018px!important; width:3020px}
.t_i_h table{width:3000px;}
.t_i_h table td{border-right:1px solid #ccc; border-bottom:1px solid #ccc; height:47px; text-align:center}
.cc{width:100%; height:220px; border-bottom:1px solid #ccc; border-right:1px solid #ccc; background:#fff; overflow:auto;}
.cc table{width:3000px; }
.cc table td{height:25px; width:100px; border-bottom:1px solid #ccc; border-right:1px solid #ccc; text-align:center}

</style>
<script>
function aa(){
var a=document.getElementById("cc").scrollTop;
var b=document.getElementById("cc").scrollLeft;
document.getElementById("dd").scrollTop=a;
document.getElementById("hh").scrollLeft=b;
}
</script>

<div class="t_n">
<span>

<table width="100%" border=0 cellpadding="0" cellspacing="0">
<tr>
<td width="21"align="center" valign="middle" background="images/tbtop_03.gif" class="tt0">审核</td>
<td width="76" align="center" valign="middle" background="images/tbtop_03.gif">姓  名</td>
</tr>
</table>
</span>
<div class="dd" id="dd">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr height="75">
<td class="tt1"><input name="shenke" type="checkbox" disabled="disabled" style="border:0" class="shenke" value="1"></td>
<td class="tt2" align="center"><%=rsxm("xingming1")%> </td>
</tr>
</tbody>
</table>
</div>
</div>
<!--table栏目-->
<div class="t_i">
<div class="t_i_h" id="hh">
<div class="ee">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign=middle>
<%for i=1 to maxday %>
<td width="337" align=center><%=i%></td>
<% next %>
<td width="88">年假</td>
<td width="88">月休</td>
<td width="88">法休</td>
<td width="88">早班</td>
<td width="88">晚班</td>
<td width="88">全天</td>
<td width="88">请假</td>
<td width="88">迟到<br>
早退</td>
<td width="88">本月<br>
加班</td>
<td width="88">累计<br>
加班</td>
<td width="88">积休</td>
</tr> </table>
</div>
</div>
<div class="cc" id="cc" onscroll="aa()">
<table border="0" cellpadding="0" cellspacing="0" class=t_number>
<%

for j=1 to 12
if j/2=int(j/2) then
bgc="#eeffef"
else
bgc="#FFFFFF"
end if
'工作

response.write "<tr bgcolor='" & bgc & "'>"
for i=1 to day(date())-1

sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='" & xm(i) & "' and kjday="& i
rslu.open sqllu,conn,3,3
if not rslu.eof then
%>
<td width="80" align=left><%=rslu("gz")%></td>
<%else
%>
<td width="80" align=left>    </td>

<%end if
rslu.close%>
<%next
%>
<td width="80" align=left>
<select name="gz" size=1>
</select>
<% response.write "</td>"
for i=day(date()+1) to maxday
response.write "<td width='70' align=left>    </td>"
next

sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and gz='年假'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu.recordcount&"天</td>"
rslu.close

sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and gz='月休'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu.recordcount&"天</td>"
rslu.close

sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and gz='法休'"
rslu.open sqllu,conn,3,3
response.write "<td rowspan='3'>"&rslu.recordcount&"天</td>"
rslu.close
sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and gz='早班'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu.recordcount&"天</td>"
rslu.close

sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and gz='晚班'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu.recordcount&"天</td>"
rslu.close

sqllu="select * from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and gz='全天'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu.recordcount&"天</td>"
rslu.close


sqllu="select sum(kq) as kqsum from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and kaoqin='请假'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu("kqsum")&"h</td>"
rslu.close

sqllu="select sum(kq) as kqsum from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and ( kaoqin='早退' or kaoqin='迟到' )"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu("kqsum")&"m</td>"
rslu.close

sqllu="select sum(jb) as kqsum from kaoqin where kjyear="& yjyear &" and kjmonth="& jmonth &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and jiaban='加班'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu("kqsum")&"h</td>"
rslu.close

sqllu="select sum(jb) as kqsum from kaoqin where kjyear="& yjyear &" and bumen='"&request("bumen") &"' and xingming='"&rsxm("xingming"&j) & "' and jiaban='加班'"
rslu.open sqllu,conn,3,3
response.write "<td width='50' rowspan='3'>"&rslu("kqsum")&"h</td>"
rslu.close
response.write "<td width='50' rowspan='3'><input size=2 type='text' name='jixiu' />天</td>"

%>
<%
response.write "</tr>"


next%>
</table>
</div>
</div>

</form>
</body>
</html>
...全文
222 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdn_aspnet 2011-12-13
  • 打赏
  • 举报
回复
你这不就是一张表吗?你可以调试你的代码或者css代码

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧