Can multiple columns in a datatable shara a common Header/Title??
Can multiple columns in a datatable shara a common Header/Title??
dt8485
Posts: 7Questions: 0Answers: 0
I have a 5 columns in a dataTable and one them have a sTitle:"Action". Can I have the other 4 columns to share the same this same title.
Below is my code:
dataTable = $('#usersTable').dataTable({
"bJQueryUI": true,
"aaData": userData,
"oLanguage": {
"sZeroRecords": "No Records Found"
},
"bDestroy": true,
"aoColumns": [{ "sTitle": "Full Name", "mDataProp": "FullName" }, { "sTitle": "UserName", "mDataProp": "UserName" },
{ "sTitle": "Email", "mDataProp": "Email" }, { "sTitle": "Role", "mDataProp": "RoleName" },
{ "sTitle": "Action", "sClass": "control center", "mDataProp": null, "sDefaultContent":
'View Details'
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
''
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
''
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
''
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
' '
}
]
});
Below is my code:
dataTable = $('#usersTable').dataTable({
"bJQueryUI": true,
"aaData": userData,
"oLanguage": {
"sZeroRecords": "No Records Found"
},
"bDestroy": true,
"aoColumns": [{ "sTitle": "Full Name", "mDataProp": "FullName" }, { "sTitle": "UserName", "mDataProp": "UserName" },
{ "sTitle": "Email", "mDataProp": "Email" }, { "sTitle": "Role", "mDataProp": "RoleName" },
{ "sTitle": "Action", "sClass": "control center", "mDataProp": null, "sDefaultContent":
'View Details'
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
''
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
''
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
''
},
{ "sClass": "control center", "mDataProp": null, "sDefaultContent":
' '
}
]
});
This discussion has been closed.
Replies
Not sure what you mean by share the same title. Can you explain? Do you mean have the header colspan=4 for these columns?
http://www.datatables.net/release-datatables/examples/basic_init/complex_header.html
[code]
ID
Action
[/code]