AJAX调用后,复选框未显示在表中(Checkbox not showing in table after AJAX call)
我在defi.php有一个带有以下AJAX调用的表单:
$('#def').submit(function (event) { var data = $(this).serialize(); $.post('defidos.php', data) .success(function (result) { $('#dos').html(result); }) .error(function () { console.log('Error loading page'); }) return false; });defidos.php有下表行,其中包含一个复选框:
<tr> <td> <input type="checkbox" name="seleccion[]" value="<?php echo $id_plantilla; ?>" /> </td> <td> <?php echo $faquerynm['cve_plaza']; ?> </td> <td> <?php echo $desc_cat; ?> </td> <td> <?php echo $faquerynm['tiempo']; ?> </td> <td> <?php echo $faquerynm['situacion']; ?> </td> <td> <?php echo $div_areal; ?> </td> </tr>通话后,未显示复选框。
如果我把复选框放在表格之外,它会正确显示。
I have in defi.php a form with the following AJAX call:
$('#def').submit(function (event) { var data = $(this).serialize(); $.post('defidos.php', data) .success(function (result) { $('#dos').html(result); }) .error(function () { console.log('Error loading page'); }) return false; });defidos.php has the following table row which contains a check box:
<tr> <td> <input type="checkbox" name="seleccion[]" value="<?php echo $id_plantilla; ?>" /> </td> <td> <?php echo $faquerynm['cve_plaza']; ?> </td> <td> <?php echo $desc_cat; ?> </td> <td> <?php echo $faquerynm['tiempo']; ?> </td> <td> <?php echo $faquerynm['situacion']; ?> </td> <td> <?php echo $div_areal; ?> </td> </tr>After the call the checkbox is not shown.
If I put the checkbox outside the table it shows correctly.
最满意答案
我用css解决了这个问题,用div创建表。
#container { display: table; } #row { display: table-row; } #left, #right, #middle { display: table-cell; text-align: center; } .titulos { font-weight: bold; }有了这个,复选框显示正确
I solved the problem using css , creating the table with divs .
#container { display: table; } #row { display: table-row; } #left, #right, #middle { display: table-cell; text-align: center; } .titulos { font-weight: bold; }With this the checkbox shows correctly
更多推荐
发布评论