【发布时间】:2013-10-12 18:08:34
【问题描述】:
我想用一个使用 Append 函数的 Javascript 来构建一个列表。
我有一个 index.php 文件、一个 script.js 文件和一个用于进行 mysql 查询的 search.php 文件。
我得到了一切工作,但布局不是最好的。所以我很清楚如何使布局更好。
我希望它显示为一个列表,这应该用 CSS 或表格来完成?
现在它只是像这样显示 414622570992222
this.number=70992222 this.code=4146225
所以我希望它喜欢的是一个没有像这样的寄宿生的列表(但没有边界)。
----------------------
| Number | Code |
----------------------
| 70992222 | 4146225 |
----------------------
这是我的 script.js 文件中的一些代码。
$.each(data.results, function(){
//Give the list element a rel with the data results ID incase we want to act on this later, like selecting from the list
$('#results-list').append("<li rel='" + this.number + "'>" + this.code + this.number + "</li>");
这是我的 index.php 文件中的显示行
<div id='results-holder'>
<ul id='results-list'>
【问题讨论】:
-
我会使用表格来存储表格数据。
标签: javascript php jquery css