下面是我的一个Stuts2页面
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>List Books</title>
</head>
<body>
<img src="img/bg.jpg" width=100% />
<br>
<div>
<table border=1 cellspacing=1 style="word-break: keep-all" width=100% fixed=true >
<s:iterator value="list" var="books">
<tr>
<td width=100><s:property value="#books.categorieNo" /></td>
<td width=100><s:property value="#books.title" /></td>
<td width=100><s:property value="#books.author" /></td>
<td width=100><s:property value="#books.edition" /></td>
<td width=100><s:property value="#books.noOfCopies" /></td>
<td width=100><s:property value="#books.description" /></td>
<td width=100><s:property value="#books.price" /></td>
<td width=100><s:property value="#books.fileName" /></td>
<td width=100><s:property value="#books.publications" /></td>
<td width=100><img src="<s:property value="#books.image" />" /></td>
<td width=100><s:checkbox name="checkBox" /></td>
<td width=100><s:textfield id="quantity" required="true"></s:textfield></td>
</tr>
</s:iterator>
</table>
</div>
</body>
</html>
我想让他们都在同一行显示,可是最后两列的checkbox和textfield总是跟前面的不再一行,是什么原因啊?
求解答!!!
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>List Books</title>
</head>
<body>
<img src="img/bg.jpg" width=100% />
<br>
<div>
<table border=1 cellspacing=1 style="word-break: keep-all" width=100% fixed=true >
<s:iterator value="list" var="books">
<tr>
<td width=100><s:property value="#books.categorieNo" /></td>
<td width=100><s:property value="#books.title" /></td>
<td width=100><s:property value="#books.author" /></td>
<td width=100><s:property value="#books.edition" /></td>
<td width=100><s:property value="#books.noOfCopies" /></td>
<td width=100><s:property value="#books.description" /></td>
<td width=100><s:property value="#books.price" /></td>
<td width=100><s:property value="#books.fileName" /></td>
<td width=100><s:property value="#books.publications" /></td>
<td width=100><img src="<s:property value="#books.image" />" /></td>
<td width=100><s:checkbox name="checkBox" /></td>
<td width=100><s:textfield id="quantity" required="true"></s:textfield></td>
</tr>
</s:iterator>
</table>
</div>
</body>
</html>
我想让他们都在同一行显示,可是最后两列的checkbox和textfield总是跟前面的不再一行,是什么原因啊?
求解答!!!
<constant name="struts.ui.theme" value="simple"/>
可以解决你的问题!
默认情况下 他会对s标签的内容进行简单布局
不过这个布局的效果不是太好
我通常都是用 simple=false 自己来对页面布局
这个吗?没有设置图片的大小。图片把表格撑大了。
属性要小写,值要加双引号,不要用百分比!
例如:
<images src="URL" width="20" height="20"/>