zoukankan      html  css  js  c++  java
  • 关于Struts2的界面的摆放

    控件有的时候怎么放都感觉放不到自己想要的位置,这时候可以有这几个做法

    1.用一个table标签来创建一个表格,再在表格里面一行一列地放,比较整齐

    2.用表格,结果却发现有的控件位置莫名其妙,这时候就要加一个form标签,再设置主题 theme="simple",就不会变的很奇怪

    例子

     1   <s:form action="Login.action" method="post" theme="simple"><!-- 检验必须用xhtml主题才会显示 -->
     2   <s:property value="errors['user.login_username'][0]" /><br>
     3   <s:property value="errors['user.login_passward'][0]" /><br>
     4   <s:property value="errors['user.code'][0]" />
     5       <table border="1">
     6       <tr>
     7         <td width="60px">用户名:</td>
     8         <td width="60px"><s:textfield name="user.login_username"  label="用户名"></s:textfield></td>
     9       </tr>
    10      <tr>
    11         <td width="60px">密码:</td>
    12         <td width="60px"><s:password name="user.login_passward"  label="密码"></s:password></td>
    13       </tr>
    14       <tr>
    15         <td width="60px">验证码:</td>
    16         <td width="60px"><s:textfield name="user.code" label="验证码"></s:textfield></td>
    17       </tr>
    18       <tr>
    19           <td width="60px"></td>
    20           <td width="60px"><img src="randPic.action"  onclick="changeValidateCode(this)" title="点击图片刷新验证码"/></td>
    21       </tr>
    22     </table>
    23     <s:submit value="登录"></s:submit>
    24   </s:form>

      <s:form action="Login.action" method="post" theme="simple"><!-- 检验必须用xhtml主题才会显示 -->  <s:property value="errors['user.login_username'][0]" /><br>  <s:property value="errors['user.login_passward'][0]" /><br>  <s:property value="errors['user.code'][0]" />  <table border="1">  <tr>    <td width="60px">用户名:</td>    <td width="60px"><s:textfield name="user.login_username"  label="用户名"></s:textfield></td>  </tr> <tr>    <td width="60px">密码:</td>    <td width="60px"><s:password name="user.login_passward"  label="密码"></s:password></td>  </tr>  <tr>    <td width="60px">验证码:</td>    <td width="60px"><s:textfield name="user.code" label="验证码"></s:textfield></td>  </tr>  <tr>  <td width="60px"></td>  <td width="60px"><img src="randPic.action"  onclick="changeValidateCode(this)" title="点击图片刷新验证码"/></td>  </tr></table><s:submit value="登录"></s:submit>  </s:form>

  • 相关阅读:
    剑指Offer——构建乘积数组
    剑指Offer——把二叉树打印成多行
    剑指Offer——二叉树的下一个结点
    剑指Offer——二叉搜索树与双向链表
    剑指Offer——二叉搜索树的后序遍历序列
    LeetCode——Construct Binary Tree from Inorder and Postorder Traversal
    LeetCode——Construct Binary Tree from Preorder and Inorder Traversal
    剑指Offer——重建二叉树2
    C++ STL基本容器的使用
    mysql中模糊查询的四种用法介绍
  • 原文地址:https://www.cnblogs.com/HangZhe/p/5933902.html
Copyright © 2011-2022 走看看