我正在提取已保存在我们的数据库中的项目"Results.ItemPicture、Results.ItemLink等."并使用带有JJ的for循环在页面上显示它们,并且想要将它们打印在页面上的列中.到目前为止,它们只是被放在彼此的顶部.我该如何着手做这件事呢?
<div class =header> </div>
<div class="app">
<main class="content">
<form action="/getItem" method="get" class="input-wrapper">
<button type="submit" class="fa fa-search"></button>
<input type="text" class="input-wrapper-text" style="color:white;" placeholder="Search" name="q">
</form>
<div style = "position: absolute; top: 175px; left: 47%;">
<h2>
Add Items
</h2>
</div>
<div style = "position: absolute; top: 250px; left: 10%;">
<h1>
Catalog
</h1>
</div>
<div style="width: 3000px; margin: 10px 0px;">
<hr size="10">
</div>
<% for (var i=0; i<results.length; i++) {%>
<div style = "display: block;">
<div style = "display: inline-block; vertical-align: top;" class = "ebayImage">
<a href = "#" class = "ebayImage" onclick="javascript:location.href='<%= results[i].ItemLink%>';" id="itemButton">
<img src= "<%= results[i].ItemPicture %>" style="width:250px; height: auto; border: 1px solid #cacaca;" alt="redirects to original eBay listing">
</a>
</div>
<div style = "display: inline-block; vertical-align: top;" class = "ebayInfo">
<a href = '<%=results[i].ItemLink%>' style = 'width: auto; margin-left: 20px; color:black;'><h3><u><%= results[i].ItemName%></u></h3></a>
<p> </p>
<p style="justify-content: space-between; width: auto; margin-bottom: 10px; margin-left: 20px; color: #5b619b; font-weight: bold;"> Points: <%= results[i].ItemPrice%></p>
<p><button type="button" style="background-color: rgb(128, 0, 0);" id="newCatItem" onclick="deleteFromCat()">Remove Item</button></p>
</div>
</div>