如何在Struts2中并排排列两个butons [英] How to arrange two butons side by side in Struts2
问题描述
我正在开发一个网页struts2如果我正确的主题在Struts2被设置,所有的标签将最终在一个表中,所以所有的标签将一个在另一个之下。
I am developing a Web page on struts2 If I am correct theme in Struts2 is set such that all the tags will eventually be inside a table so all tags will be aligned one below other.
在我的网页我有登录页面提交和重置按钮我想两个并排(彼此相邻)而不是单独的行。我尝试谷歌搜索我得到一些答案像 {display:inline; }
in CSS and also {position:float}
和 theme =simple
形成。无效
In My web page i have login page with Submit and Reset button I want both side by side (next each other) rather than in separate line.I Tried googling i got some answer like { display : inline; }
in CSS and also { position : float}
and theme="simple"
in form. Nothing worked
<table><tr><td><s:submit method="CheckUser" value="Login" align="center" /></td><td><s:reset value="Clear" align="center" /></td></tr>
如果我设置了我获得2个按钮但是 label =User Id
只给出了不带标签的文本字段
In case if i set i get the 2 buttons(submit+reset) as required
but though label="User Id"
is given i get only text field without label
<tr><td><s:textfield name="userid" label="User Id" size="25" /></td></tr>
<tr><td><s:password name="password" label="Password" size="25" /></td></tr>
请告诉我我在哪里出错,如何获得标签文本字段和submit_Reset按钮并排
Please do suggest me where I am going wrong and how to get both label to text field and also submit_Reset button side by side
推荐答案
只要保留默认的Struts2主题,即 xhtml
顺便说一句,因为它只是改变你的< s:submit>
和< s:reset>
标签添加到主题
属性值简单
。
Just leave default Struts2 theme, which is xhtml
by the way, as it is and change only your <s:submit>
and <s:reset>
tags adding to them theme
attribute with value simple
.
<s:form>
...
<tr>
<td colspan="2">
<s:submit value="Login" theme="simple"/>
<s:reset value="Clear" theme="simple"/>
</td>
</tr>
</s:form>
这篇关于如何在Struts2中并排排列两个butons的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!