我在jsp页面中,用表格显示获取到的数据,如果有多组数据,页面中的表格是默认的纵向排列,如何改为横向显示呢?
默认的显示:
jsp中的主体代码如下:
<table width="260" border="0">
<struts:action name="selectBookBySort" executeResult="false" />
<struts:iterator value="#request['bookInfo']" id="bookInfo">
<tr>
<tr>
<td width="70" height="70" rowspan="3"><img src="/onLineBookStore/bookImages/<struts:property value="#bookInfo.picture"/>" width="70"></td>
<td width="40"><font size="-1" color="#000000">书名:</font></td>
<td width="123"><FONT size="-1" face="宋体 " color="#000000"><struts:property value="#bookInfo.bookName"/></FONT></td>
</tr>
<tr>
<td><font size="-1" color="#FF0000">价格:</font></td>
<td><FONT size="-1" face="宋体 " color="#000000"><struts:property value="#bookInfo.price" /></FONT></td>
</tr>
<tr>
<td><font size="-1" color="#FF0000">折扣:</font></td>
<td><FONT size="-1" face="宋体 " color="#000000"><struts:property value="#bookInfo.discount" /></FONT></td>
</tr>
<tr>
<td><font size="-1" color="#000000">图书简介:</font></td>
<td colspan="2"><FONT size="-1" face="宋体 " color="#000000"><struts:property value="#bookInfo.discription" /></FONT></td>
</tr>
<tr>
<td><font size="-1" color="#000000">库存信息:</font></td>
<td><FONT size="-1" face="宋体 " color="#000000"><struts:property value="#bookInfo.inventory" />本</FONT></td>
<td> </td>
</tr>
<tr>
<td><font size="-1" color="#000000">我要购买:</font></td>
<td colspan="2"><form action="addCart.action" method="post">
<input type="text" name="count" size=4 value="1"/>
<input type="hidden" name="bookId" value="<struts:property value="#bookInfo.id" />"/>
<input type="submit" value="购买"/>
</form></td>
</tr>
</struts:iterator>
</table>
|