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>

  • 相关阅读:
    .Net/C# 应用程序直接读取本地 Cookies 文件(WinXP SP2 调用 API: InternetGetCookie 无果)
    wininet.dll函数库:不会过期的cookie
    WinForm中TextBox控件循环自动滚动示例
    JScript中Date.getTime转.Net中的DateTime
    js gettime c# ticks
    mysql查看整库个表详情
    rds分区实践
    mysql5.7.21源码安装
    EXPLAIN详解
    C#基础温习(4):C#中string数组和list的相互转换
  • 原文地址:https://www.cnblogs.com/HangZhe/p/5933902.html
Copyright © 2011-2022 走看看