将自定义按钮添加到 jquery DataTable 中每一行的最后一列

Add custom button to last column in every row in jquery DataTable

我正在尝试重新创建此处 Child Rows DataTables

的示例数据Table

DataTables 工作正常,我没有收到 -“第 0 行第 4 列请求的未知参数‘4’”错误。 我的问题是按钮没有在最后一列中呈现。谁能帮我解决这个问题,谢谢!

这是我的 java servlet 逻辑..

Javascript代码:

还有我的 Table -

                                <tr>
                                    
                                     <th>Employee</th>
                                     <th>Shift</th>
                                     <th>Start Date</th>
                                     <th>End Date</th>  
                                     <th>Details</th>
                                </tr>
                           </thead>
                           <tfoot>
                            <tr>
                                    
                                     <th>Employee</th>
                                     <th>Shift</th>
                                     <th>Start Date</th>
                                     <th>End Date</th>
                                     <th>Details</th>
                    
                           </tr>
                           
                           </tfoot>

在渲染函数中,需要return一个字符串。所以你只需要在你的按钮定义之前和之后添加一个单引号,就像这样 '<button>Click Here!</button>';