AJAX调用后,复选框未显示在表中(Checkbox not showing in table after AJAX call)

系统教程 行业动态 更新时间:2024-06-14 16:55:57
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

更多推荐

本文发布于:2023-04-10 11:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/8a41ba8075168e0bca94c85f7ad8b076.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:复选框   Checkbox   AJAX   call   table

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!