<td>标签的class属性在浏览器中消失,求技术解决办法
问题:表格
<td>标签添加class属性后在浏览器中消失 我开发了一个带操作按钮的数据表格,为了方便识别表格中的对应值,打算给<td>单元格添加class属性,但发现添加后在浏览器里该属性会直接消失。比如针对用户名单元格,我把代码从<td><?php echo $row['username']; ?></td>改成<td class="username"><?php echo $row['username']; ?></td>,刷新浏览器后查看元素,class属性还是不见了。不过奇怪的是,在$row['id']所在行的<strong>标签上添加class是有效的,试了各种搜索到的方案都没解决,特来求助。
以下是我的部分代码:
if(mysqli_num_rows($fetch_query_run) > 0) { while($row = mysqli_fetch_array($fetch_query_run)) { ?> <tr> <td><strong class="user_id"><?php echo $row['id']; ?></strong></td> <td><?php echo $row['username']; ?></td> <td><?php echo $row['position']; ?></td> <td><?php echo $row['merits']; ?></td> <td><?php echo $row['overallflights']; ?></td> <td><?php echo $row['timezone']; ?></td> <td> <button class="btn btn-datatable btn-icon btn-transparent-dark me-2 edit_data"><i class="fa-solid fa-ellipsis-vertical"></i></button> <button class="btn btn-datatable btn-icon btn-transparent-dark delete_data"><i class="fa-regular fa-trash-can"></i></button> </td> </tr> <?php } } else { ?> <tr colspan="7">No Record Found</tr> <?php }
附上属性消失的截图:
内容的提问来源于stack exchange,提问作者Coolebooster
相关产品推荐
相关产品推荐

