Can I add an html5 data- attribute when initializing data using columns method?
Can I add an html5 data- attribute when initializing data using columns method?

Sorry if this question has already been answer, I swear I've spent time looking and can't find an answer to this specific question.
I'm just wondering if there is a way to directly add an html5 data- tag directly to a column when initializing my datatable using the columns method, like below:
columns: [
{
class: "text-left",
data: "destination",
},
{
class: "text-center",
data: "purpose",
},
{
class: "text-left",
data: "sponsors",
},
{
class: "text-left",
data: "chaperones",
},
{
class: "text-left",
data: "trainedStaff",
},
{
class: "text-center",
data: "transportationType",
***** ADD DATA - TAG HERE *****
data-transBaseName = ***
},
],
I've found this article showing how to do it using the createdRow method but wanted to see if there was a way to do it directly in the columns definition?
This question has an accepted answers - jump to answer
Answers
You can use
columns.createdCell
for that particular column.Kevin
You are my new forever-hero!!