【发布时间】:2019-06-17 09:58:43
【问题描述】:
我有一些物品需要像亚马逊一样显示为每行 4 件物品。下图是亚马逊。
这就是我想要的:
这是我得到的:
代码:
function loadBooksTable(){
axios.get(baseUrlLocal + '/book/info')
.then(function (response) {
console.log(response)
console.log(response.data)
response.data.forEach(request => {
i=i+1;
html = '<tr>'
html +='<td align="center">'+request.ISBN+'</br>' ;
html +=request.BookName+'</br>' ;
html +=request.Author+'</br>' ;
html +=request.PricePerDay + '</br>';
html +='<img id="thumb" style="width:80px;height:80px" src="./images/'+ request.ISBN +'.png"/>' + '</br>';
html +=isRented(request.Rented) + '</br>';
'</td>' ;
html +='</tr>';
$('#view-all-books tbody').append(html);
});
})
.catch(function (error) {
// handle error
console.log(error);
});
}
【问题讨论】:
-
好的,这是一个打字错误。编辑了问题。知道的请回答