前端

img studyday

关于与

发表于2004/9/28 11:44:00  626人阅读


此种状态复选框全为不选:

<table border="1" width="100%"  >
         <tr>
          <td width = "200"></td>
            <td width="100%"><div align="center">
                <logic:iterate id="loop" name="arrays">
                    <div align="center">
                       <html:multibox  property="arrays">
                        <bean:write name="loop" property="mat_id"/>    
                       </html:multibox>
                      <bean:write name="loop" property="mat_name"/>
                  </div>
              </logic:iterate>
              </div>
            </td>
        </tr>
       </table>


 

此种情况复选框全为选中

<table border="1" width="100%"  >
         <tr>
          <td width = "200"></td>
            <td width="100%"><div align="center">
                <logic:iterate id="loop" name="arrays">
                    <div align="center">
                       <html:multibox name="loop" property="mat_id">
                        <bean:write name="loop" property="mat_id"/>    
                       </html:multibox>
                      <bean:write name="loop" property="mat_name"/>
                  </div>
              </logic:iterate>
              </div>
            </td>
        </tr>
       </table>

其中,<html:multibox >的property属性可取form中的属性。

排成三列的代码:

<table border="0" width="100%"  >
      
         <% int i = 0; %>
         <logic:iterate id="loop" name="arrays" >
         <%          
              if(i%3==0){
                out.println("<tr>");
              }
         %>
             <td width="30%" wrap>
               <html:multibox  property="arrays">
                  <bean:write name="loop" property="mat_id"/>
               </html:multibox>
                  <bean:write name="loop" property="mat_name"/>
              </td>  
              <%
                 i = i + 1;
                 if(i%3==0){
                out.println("</tr>");               
                }
               
              %>
          </logic:iterate>
         
       </table>

阅读全文
0 0

相关文章推荐

img
取 消
img