如何使用javascript限制表中的行数

时间:2015-03-05 21:34:48

标签: javascript html jsp

真的不知道如何开始,研究了这么长时间,这似乎是我的最后选择。我有一个连接到数据库的表。

<table border="1" style="width:100%;">
<tr>
<th>Code</th>
<th>Author</th>
<th>Name</th>
<th>Description</th>
<th>Price</th>

</tr>

<c:forEach var = "row" items = "${result.rows}">
<tr>
<td><c:out value = "${row.item_code}"/></td>
<td><c:out value = "${row.item_author}"/></td>
<td><c:out value = "${row.item_name}"/></td>
<td><c:out value = "${row.item_description}"/></td>
<td><c:out value = "${row.item_price}"/></td>
<td> <a href="jsporder.jsp?itemCode=${row.item_code}">Buy! </a> </td>
<td> <img src="<c:url value = "${row.item_image_loc}"/>" height="50" style="border:none; background:none; overflow:none; width:35%" alt="Connection to mySQL for pictures"/></td>
</tr>
</c:forEach>
</table>
</div>

例如,表格看起来像这样。

代码作者姓名描述价格

12 .... .... J.K ... Potter.Wizard£2.12 ...购买!....(图像)

等(还会有10多本书)。

我想做的是制作一个java脚本函数表单,我输入了我想要出现在桌面上的书籍数量。

因此,例如,如果我输入2,则只会在数据库中显示前2本书。

0 个答案:

没有答案