Add className or Id to columns in Datatable

Add className or Id to columns in Datatable

swcoreswcore Posts: 3Questions: 1Answers: 0

var topTable = $('#topTable').DataTable();

dataResult.map((eachData,index) => {
topTable.row.add([ eachData.id, eachData.name, eachData.dep])
}

topTable.draw()

I want to add classname or id class="name-"+index to the columns, such that

tr
td
td(class="name-0) name
td
tr
td
td(class="name-1)
td

Answers

This discussion has been closed.