在拉动滚动条的时候,出现了Commbox把Table的标题遮住的问题,请高手指教我的Jsp也贴出来<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="bean" prefix="bean" %>
<%@ taglib uri="html" prefix="html" %>
<%@ taglib uri="logic" prefix="logic" %>
<%@ taglib uri="template" prefix="template" %><script language="JavaScript">var delMsg = "<bean:message key="C8003"/>";function onClear(){
document.mst016Form.payTerms.value="";
document.mst016Form.period.value="";
document.mst016Form.from.value="";
document.mst016Form.display1.value="";
}function onSearch(){
document.mst016Form.listFlag.value = 0;
    document.mst016Form.action="mst016Action.do?method=search"
    document.mst016Form.submit();
}function changePage(listFlag){
    document.mst016Form.listFlag.value=listFlag;
    document.mst016Form.action="mst016Action.do?method=search"
document.mst016Form.submit();
}function onDelete(){

if(document.mst016Form.selectIndex.value == "-1"){
alert("Please select the recorder");
return;
}

if (confirm(delMsg)){
var table=document.getElementById("PayTermsTable"); 
var tr=table.getElementsByTagName("tr"); 
document.mst016Form.selectedPayTerms.value
= table.rows[document.mst016Form.selectIndex.value].cells[1].innerText;
document.mst016Form.selectedPeriod.value
= table.rows[document.mst016Form.selectIndex.value].cells[2].innerText;
document.mst016Form.selectedFrom.value
= table.rows[document.mst016Form.selectIndex.value].cells[3].innerText;     document.mst016Form.action="mst016Action.do?method=delete";
    document.mst016Form.submit();
}
}function onUpdate(){

if(document.mst016Form.selectIndex.value < 0){
alert("Please select the recorder");
return;
} var table=document.getElementById("PayTermsTable"); 
var tr=table.getElementsByTagName("tr"); 
document.mst016Form.selectedPayTerms.value
= table.rows[document.mst016Form.selectIndex.value].cells[1].innerText;
document.mst016Form.selectedPeriod.value
= table.rows[document.mst016Form.selectIndex.value].cells[2].innerText;
document.mst016Form.selectedFrom.value
= table.rows[document.mst016Form.selectIndex.value].cells[3].innerText;
document.mst016Form.strInsertUpdateFlg.value="2";    document.mst016Form.action="mst016UpdateAction.do?method=initUpdate";
    document.mst016Form.submit();
}function onAdd(){
document.mst016Form.strInsertUpdateFlg.value="1";
    document.mst016Form.action="mst016NewAction.do?method=initNew";
    document.mst016Form.submit();
}function onRClick(obj){
var rowIndex = obj.rowIndex - 1;
if (obj.bgColor == "#ffff99"){

document.getElementById("select" + rowIndex).bgColor="#CCCCCC";
document.mst016Form.selectModelCode.value = "";
}else{
for(var i=0;i<obj.parentElement.rows.length - 1;i++){
document.getElementById("select"+i).bgColor="#CCCCCC";
   }

document.getElementById("select"+rowIndex).bgColor="#ffff99";
document.mst016Form.selectModelCode.value = document.getElementById("select"+rowIndex).name;
}
}function trclick(obj){
var rowIndex = obj.rowIndex-1;
var table=document.getElementById("PayTermsTable"); 
var tr=table.getElementsByTagName("tr"); 
var i;
for(i = 0; i<tr.length; i++){
    if (tr[i] != null) {
tr[i].bgColor="";
}
   }
obj.bgColor="#ffff99";
document.mst016Form.selectIndex.value=rowIndex;
}</script>
<head>
<title>G-LOGOS PAY TERMS Master Maintenance</title>
<LINK rel="stylesheet" type=text/css href= "css/main.css">
</head>
<style>
div.y_scroll {
  overflow-y:scroll;
  overflow-x:scroll;
  border-style:none;
  border-width:1px;
  border-color:black;
}
th.lock{ position: relative; 
    top: expression(document.getElementById("list").scrollTop); 
    z-index: 10;}
</style>
</HEAD>

解决方案 »

  1.   

    <BODY bgcolor="#CCCCCC">
    <font color="red" size="4"><html:errors/></font>
    <html:form action="/mst016Action.do?method=init">
    <html:hidden property="currentPageNo" name="mst016Form"/>
    <html:hidden property="listFlag" name="mst016Form"/>
    <html:hidden property="selectIndex" name="mst016Form"/>
    <html:hidden property="selectedPayTerms" name="mst016Form"/>
    <html:hidden property="selectedPeriod" name="mst016Form"/>
    <html:hidden property="selectedFrom" name="mst016Form"/>
    <input type="hidden" name="strInsertUpdateFlg" value="">

    <table width="957" border="0" cellpadding="0" align="center" cellspacing="0" id="TopTBL">
    <tr>
      <td>
    <table width="100%" border="0" align="center">
         <tr>
    <td width="85%">
    <fieldset style="WIDTH:100%">
    <legend><DIV style="TEXT-DECORATION: underline"><bean:message key="common.searchKey"/></DIV></legend>
    <table width="100%"  align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" width="12%">Pay Terms</td>
    <td align="left" width="10%">
    <input name="payTerms" type="text" class="input" 
    value="<bean:write name="mst016Form" property="payTerms"/>" size="4" maxlength="2">
    </td>
    <td align="center" width="9%">Period</td>
    <td align="left" width="7%">
    <input name="period" type="text" class="input"
    value="<bean:write name="mst016Form" property="period"/>" size="6" maxlength="3">
    </td>
    <td align="center" width="10%">From</td>
    <td width="5%" align="left" >
    <input name="from" type="text" class="input"
    value="<bean:write name="mst016Form" property="from"/>" size="2" maxlength="1">
    </td>
    <td align="center" width="12%">Display1</td>
    <td  align="left" >
    <input name="display1" type="text" class="input"
    value="<bean:write name="mst016Form" property="display1"/>" size="50" maxlength="40">
    </td>
    </tr>
    </fieldset>
    </table>
    </td>
    <td align="left" valign="bottom" style="padding-bottom:6px">
    <input name="search" style="width:60px;" type="button"  class="Font9BoldWhite" 
    onclick="javascript:onSearch();" value="Search" />
    <input name="clear" type="button" style="width:60px;" class="Font9BoldWhite" 
    onclick="onClear();" value="Clear" /></td>
       </tr>
    </table>
      
    <br>
    <logic:present name="PAY_TERMS_REQUEST_LIST" scope="request">
    <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="325"><div style="font-weight:bolder; margin-top:20px; font-size:11pt;"><bean:message key="mst016Form.payTerms"/></DIV> </td>
        <td width="112"><bean:message key="common.page"/> <bean:write name="mst016Form" property="pageNo"/>/<bean:write name="mst016Form" property="totalPage"/></td>
        <td width="141"><bean:message key="common.total"/> <bean:write name="mst016Form" property="totalSize"/> <bean:message key="common.record"/> </td>
        <td width="169">
    <IMG src="images/igsh_pagerfp.gif" alt="First Page" onclick="javascript:changePage(1)"/>
    <IMG src="images/igsh_pagerpp.gif" alt="Previous Page" onclick="javascript:changePage(2)"/>
    <html:text property="pageNo" size="2"/>
    <input type="button" name="go" value="Go" onclick="javascript:changePage(5)"/>
    <IMG src="images/igsh_pagernp.gif" alt="Next Page" onclick="javascript:changePage(3)"/>
    <IMG src="images/igsh_pagerlp.gif" alt="Last Page" onclick="javascript:changePage(4)"/>
        </td>
        <td width="201" align="right">
            <html:select name="mst016Form" property="pageSize">
    <html:options collection="PAGE_ROW_LIST" property="pageRow" labelProperty="pageRow" />
            </html:select>
          <bean:message key="common.rowsPage"/></td>
    </tr>
    </table>
    <div id="list" style="overflow-y:scroll;
      overflow-x:none;
     border:1px solid;
      border-color: #666666;
       border-top:#FFFFFF;
      width:957px;
      height:340px;
      position: relative; ">
    <table id="PayTermsTable" width="98%" border="1" cellpadding="0" style="border-top:0px">
    <tr class="MToolBar">
      <th width="4%" class="lock">Row</th>
    <th width="8%" class="lock"><bean:message key="mst016Form.payTerms"/></th>
    <th width="6%" class="lock"><bean:message key="mst016Form.period"/></th>
        <th width="6%" class="lock"><bean:message key="mst016Form.from"/></th>
        <th width="37%" class="lock"><bean:message key="mst016Form.message1"/></th>
            <th bclass="lock">Message2</th>
    </tr>
        <logic:iterate id="payTerms" name="PAY_TERMS_REQUEST_LIST" scope="request" indexId="i">
    <tr onclick="trclick(this);">
    <td align="center"><%=i+1%></td>
    <td align="center"><bean:write name="payTerms" property="payTerms"/></td>
    <td align="center"><bean:write name="payTerms" property="payPeriod"/></td>
        <td align="center"><bean:write name="payTerms" property="payFrom"/></td>
        <td align="center"><bean:write name="payTerms" property="paymentDisplay1"/>&nbsp;</td>
            <td align="center"><bean:write name="payTerms" property="paymentDisplay2"/>&nbsp;</td>
    </tr>
    </logic:iterate>
    </table>
    </div>
    <table align="center" width="99%" border="0" cellpadding="0" cellspacing="0" style="margin-top:30px">
    <tr>
    <td align="right">
    <input type="button" name="maintenamce" class="Font9BoldWhite" value="New" onclick="onAdd();">
    <input type="button" name="maintenamce" class="Font9BoldWhite" value="Update" 
    onclick="onUpdate();">
    <input type="button" name="delete" class="Font9BoldWhite" style="width:60px;"
    onclick="onDelete();" value="Delete"></td>
    </tr>
    </table>
      </td>
    </tr>
    </table>
    </logic:present>
    </html:form>
    </BODY>