亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何解決Jquery數據表中無法設置未定義的屬性“_DT_CellIndex”

如何解決Jquery數據表中無法設置未定義的屬性“_DT_CellIndex”

PHP
梵蒂岡之花 2023-07-08 17:31:26
<?php? ? if(mysqli_num_rows($result)>0)? ? {?>? ? ? ? <table class="table table-striped" id="example" align="center">? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <thead>? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Name</th>? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Email</th>? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Position</th>? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Action</th>? ? ? ? ? ? ? ? </thead>? ? ? ? ? ? </tr>? ? ? ? ? ? ? ? <tbody id="myTable">? ? <?php? ? ? ? echo "<tr>";? ? ? ??? ? ? ? while($row=mysqli_fetch_assoc($result))? ? ? ? {? ? ? ? ? ? $id = $row['id'];? ? ? ? ? ? echo "<td style='padding:7px'>".$row["name"]."</td>";? ? ? ? ? ? echo "<td style='padding:7px'>".$row["email"]."</td>";? ? ? ? ? ? echo "<td style='padding:7px'>".$row["position"]."</td>";? ? ? ? ? ? ?>? ? ? ? ? ? <td style='padding:7px'><button class="btn btn-info"? onclick="deleteUser('<?php echo $row['id'];?>')"> <i class="fa fa-trash"></i> DELETE </button> |? ? ? ? ? ? <a class="btn btn-info" href="edit_user.php?id=<?php echo $row['id'];?>"> <i class="fa fa-pencil"></i> EDIT</a> |? ? ? ?? ? ? ? ? ? <button class="btn btn-info? abc" value="View Data" data-id="<?php echo $row['id']; ?>">? <i class="fa fa-eye"></i> VIEW DATA </button>? ??? ? ? ? ? ? </td>? ??? ??? ? ? ? ? ? <?php echo "</tr>";?? ? ? ? } ?>? ? ? ? ? ? ? ? </tbody>? ??? ? ? ? ? ? ? ? <tfoot>? ? ? ? ? ? ? ? <th style="padding:7px">Name</th>? ? ? ? ? ? ? ? <th style="padding:7px">Email</th>? ? ? ? ? ? ? ? <th style="padding:7px">Position</th>? ? ? ? ? ? ? ? <th style="padding:7px">Action</th>? ? ? ? ? ? ? ? </tfoot>? ? ? ? ? ? ? ??? ? ? ? <?php? ? ? ? ?echo "</table>";? ? ? ? ?? ? ?}? ? else? ? ? ? {? ? ? ? ? ? echo "No row exists";? ? ? ? }? ? ?>我正在使用 Jquery Datatable 來排序、搜索和分頁數據。在我運行代碼后,它顯示錯誤 _DT_CellIndex' 未定義。?<tr>、<td>、<th>、<thead>、<tbody>、<tfoot>標簽正確使用并正確關閉。
查看完整描述

1 回答

?
紅顏莎娜

TA貢獻1842條經驗 獲得超13個贊

首先,我在谷歌上搜索了您的錯誤,看起來這通常意味著您的表在某種程度上存在格式錯誤,例如行大小不匹配。

它說“錯誤:您不能在 thead 組之前定義任何行”

我很確定你的問題是你需要嵌套tr在 的內部thead,而不是相反:

? ? ? ? <table class="table table-striped" id="example" align="center">

? ? ? ? ? ? <thead>

? ? ? ? ? ? ? ? <tr>


? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Name</th>

? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Email</th>

? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Position</th>

? ? ? ? ? ? ? ? ? ? <th style="padding:7px">Action</th>

? ? ? ? ? ? ? ? </tr>

? ? ? ? ? ? </thead>


查看完整回答
反對 回復 2023-07-08
  • 1 回答
  • 0 關注
  • 148 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號