我有一个table table-bordered table-hover table-stripped
表加载了一些数据。 我使用ajax重新加载行,表变得丑陋,失去了表格边框,表格悬停和表格剥离引导类的所有属性。 如何重新加载这些属性?它是否带有JS?如何重新初始化已加载的引导表?
编辑: 以下是代码。
表:
<table class="table table-bordered table-hover table-stripped" id="data_list">
<tr>
<th>Lot</th>
<th>size</th>
</tr>
<?php foreach ($lots as $lot): ?>
<tr>
<td><?php echo $lot['id']; ?></td>
<td><?php echo $lot['size']; ?></td>
</tr>
<?php endforeach ?>
</table>
JS:
...
$.ajax({type: "POST",cache: false,url: '?', dataType: "html", data: submitdata,
success: function(res) {
$('#data_list').html(res);
},
error: function(xhr, ajaxOptions, thrownError) {
bootbox.alert("There was an error, try again. "+thrownError);
},
async: true
});
AJAX响应:
<tr>
<th>Lot</th>
<th>Size</th>
</tr>
<tr>
<td>38706000524</td>
<td>30</td>
</tr>
你怎么样“重装”表?你可以在那里提供你的代码 – haxxxton
。谢谢 –
你是否从服务器返回正确的内部html表格? “res”中的数据是什么? – haxxxton