我的表头和表中查询得到的是数据是动态的.表头有几个字段未定.现在我调出来的4个字段时对齐了.15个就多不齐了.(我指表头和数据对齐).还有加上滚动条就又不齐了.我现在表头和数据是两个表.各位有什么高招啊.谢谢了!

解决方案 »

  1.   

    你用dreamweaver编辑编辑就知道了  一般调colspan
      

  2.   

    把你的源码贴出来吧。我们一般都是把表头跟数据做成一个表,所以不存在这个问题,你去深入研究一下HTML的相关知识就OK了。
      

  3.   

    用Table就齐了呀? 一定是程序没有写好
      

  4.   

    不是啊.用一个TABLE的放话数据多的话就会把表头滚没有了
      

  5.   

         <%int ilength = 781+ 40*searchForm.getCLSYMD();
         String str1 = String.valueOf(ilength) + "px";
         String str2 = String.valueOf(ilength+200) + "px";
         %>
         <table width="<%=str1%>"  border="0" class="LIST">
            <tr>
                <th rowspan="2" colspan="1" width="23px" class="LIST" nowrap="nowrap">No.</th>
                <th rowspan="2" colspan="1" width="68px" class="LIST" nowrap="nowrap">
    <html:button property="<%=SKConstant.ALL%>" value="すべで選択 " onclick="onSubmit(this.name); " styleClass="BUTTON" style="width:65px"/>
                </th>
                <th rowspan="1" colspan="2" class="LIST" nowrap="nowrap">受講者</th>
                <th rowspan="1" colspan="<bean:write name="sk0511SearchForm" property="CLSYMD" />" <%if (searchForm.getCLSYMD()<4){%>width="150px" <%}%> class="LIST" align="center">出席状況</th>
                <th rowspan="2" colspan="1" width="65px" class="LIST" nowrap="nowrap">学科試験</th>
                <th rowspan="2" colspan="1" width="65px" class="LIST" nowrap="nowrap">実技試験</th>
                <th rowspan="2" colspan="1" width="80px" class="LIST" nowrap="nowrap">修了年月日</th>
                <th rowspan="2" colspan="1" width="80px" class="LIST" nowrap="nowrap">修了証番号</th>
                <th rowspan="2" colspan="1" width="70px" class="LIST" nowrap="nowrap">修了状況</th>
                <th rowspan="2" colspan="1" width="80px" class="LIST" nowrap="nowrap">コメント</th>
                <th rowspan="2" colspan="1" width="60px" class="LIST" nowrap="nowrap">振替先<BR>予約No.</th>
                
            </tr>
            <tr>
                <th rowspan="1" colspan="1" width="75px" class="LIST" nowrap="nowrap">氏名</th>
                <th rowspan="1" colspan="1" width="75px" class="LIST" nowrap="nowrap">会社名</th>
             <logic:iterate name="sk0511SearchForm" property="clsYmd" id="ymd">
                    <th rowspan="1" class="LIST" width="40px">
                       <bean:write name="ymd" />
                    </th>
                </logic:iterate>
            </tr>
       </table>
    <div style="height: '290px';  overflow: auto;  align=left" >
         <logic:present name="sk0511SearchForm" property="listForm">
         <table class="LIST" style = "WORD-BREAK: break-all" >
         <logic:iterate name="sk0511SearchForm" property="listForm" id="list">
         <tr>
            <td rowspan="1" colspan="1" width="20px" class="LIST_CENTER">
            <bean:write name="list" property="DSPSEQ" />
            </td>
                <td rowspan="1" colspan="1" width="68px" class="LIST_CENTER">
                <bean:define id="var" name="list" property="DSPSEQ"/>  
                <%
             String strid= var.toString();%>
                       <html:multibox property = "checkBox" value ="<%=strid%>"/>
                </td>
                <td rowspan="1" colspan="1" width="75px" class="LIST">
                    <a href=""><bean:write name="list" property="NAM" /></a>
                </td>
                <td rowspan="1" colspan="1" width="75px" class="LIST"><bean:write name="list" property="COPNAM" /></td>
                
                 <%for(int i = 0; i<15; i++){
                 String str = "CLSATT";
                 %>
                
                 <logic:equal property="<%=str + String.valueOf(i+1)%>" name="list" value= "1">
                 <td rowspan="1" colspan="1" width="41px" class="LIST_CENTER">
                    ○
                 </td>
                    </logic:equal>
                 <logic:equal property="<%=str + String.valueOf(i+1)%>" name="list" value= "0">
                   <td rowspan="1" colspan="1" width="41px" class="LIST_CENTER">
                    ×
                   </td>
                    </logic:equal>
                         
                    <%}%>            
                
                <td rowspan="1" colspan="1" width="65px" class="LIST_CENTER">
                <bean:write name="list" property="WRTTSTNAM1" />
                </td>
                <td rowspan="1" colspan="1" width="65px" class="LIST_CENTER">
    <bean:write name="list" property="PRATSTNAM1" />
                </td>
                <td rowspan="1" colspan="1" width="80px" class="LIST_DATE">
                <bean:write name="list" property="CERYMD1" /></td>
                <td rowspan="1" colspan="1" width="80px" class="LIST_CENTER">
                <bean:write name="list" property="CERISENO1" /></td>
                <td rowspan="1" colspan="1" width="70px" class="LIST_CENTER">
                <bean:write name="list" property="ENDSTSNAM" /></td>
                <td rowspan="1" colspan="1" width="80px" class="LIST">
                <bean:write name="list" property="COMMENT" /></td>
                <td rowspan="1" colspan="1" width="60px" class="LIST">
                <bean:write name="list" property="NEWRSVNO" /></td>
                <tr>
                
             </logic:iterate>   
         </table>
         </logic:present>
         </div>