如何在相同位置添加按鈕,但在右側(cè)(下圖)。我的按鈕和我想把它放在哪里我正在使用燒瓶(python)和 js。我自己找不到解決方案。我在 json 中獲取數(shù)據(jù)。html代碼表:!-- Build datatable --><div class="row-90"> <table class="table display" id="calEvents"> <thead> <tr> <th scope="col">ID</th> <th scope="col">GROUP</th> <th scope="col">WEEKDAY</th> <th scope="col">DATE</th> <th scope="col">TICKER</th> <th scope="col">EVENT</th> <th scope="col">READX</th> <th scope="col">ACTION </th> </tr> </thead> </table>和java腳本。 $('#calEvents').DataTable( { "processing": true, "serverSide": false, "order": [[ 3, "asc" ]], "ajax": "/api/v1/calendar/get", 'columnDefs': [ { targets: 2, render: function(data1){ return moment(data1).format('dddd')}, }, { targets: 3, render: function(data2){ return moment(data2).format('YYYY-MM-DD')}}, ] } );
1 回答

慕村225694
TA貢獻(xiàn)1880條經(jīng)驗(yàn) 獲得超4個(gè)贊
我發(fā)現(xiàn)解決方案使用目標(biāo):-1,然后在數(shù)據(jù)表中最后添加按鈕。我的代碼
targets: -1, defaultContent: '<button name="edit" class="btn btn-secondary" type="button">Edit</button>' + '  <button name="delete" class="btn btn-danger" type="button">Delete</button>'
添加回答
舉報(bào)
0/150
提交
取消