我有具有搜索表单的索引文件。搜索的结果是一张表格。我在index.php中的原始表使用数据表,风格和功能都很完美。这里要说的是显示了searchDate.php文件的结果采取的结果我的index.php文件的一部分: 来源: 要: 阿贾克斯输出没有风格
<select name="dateOption" id="dateOption">
<option value="order"> Order </option>
<option value="inventory"> Inventory </option>
<option value="po"> PO# </option>
</select>
<input type="text" name="searchinput" id="searchinput" />
<input type="button" value="SUBMIT" onclick="getDate();" />
</form>
这里是GETDATE()函数:
function getDate() {
$.post('searchDate.php' , { dateKey: $("#searchinput").val(),
selected: $("#dateOption").val(),
from: $("#date").val(),
to: $("#date2").val()
},
function(output) {
$('#mainTable').empty();
$('#orderSearch').empty();
$('#newOrder').empty();
$(".line").hide();
$("#loadNewInvoice").hide();
$('#searchResult').append(output);
$('#searchResult').css('display','block');
$('#searchResult').show("blind");
});
}
的结果是相同的id和类作为我原来的工作表的一个表格。但是,结果不起作用,没有风格。 预先感谢您。 编辑: 这里是css和我的数据表结构,以防万一:
table.display {
margin: 0 auto;
clear: both;
width: 100%;
}
table.display thead th {
padding: 3px 18px 3px 10px;
border-bottom: 1px solid black;
font-weight: bold;
cursor: pointer;
* cursor: hand;
}
table.display tfoot th {
padding: 3px 18px 3px 10px;
border-top: 1px solid black;
font-weight: bold;
}
table.display tr.heading2 td {
border-bottom: 1px solid #aaa;
}
table.display td {
padding: 3px 10px;
}
table.display td.center {
text-align: center;
}
数据表:
$(document).ready(function() {
var oTable = $('#theTable').dataTable({
"bPaginate": true,
"bScrollCollapse": true,
"iDisplayLength": 15,
"oLanguage": {
"sSearch": "Search all columns:"
},
"aoColumnDefs": [
{ "asSorting": [ "desc" ], "aTargets": [ 0 ] }
]
});
可以显示的CSS? – 2012-08-04 10:35:18
以及css来自datatables演示文件我只是修改了一下。它与我在页面中的原始表格相同,因此我确信这些样式必须工作,因为两个表格都是相同的,但搜索的结果显然与原始表格不同。 – theWebLover 2012-08-04 10:44:14
如果在桌面上应用css样式,请参阅firebug? – 2012-08-04 10:51:11