我有具有搜索表單的索引文件。搜索的結果是一張表格。我在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