Hi @Mohammad Qasim ,
I just made an example for your reference as below, which
- Add data in a javascript object
- Use datatable to render the data
- Use datatable drawcallback function to group the rows
More details, you can refer to below demo.
<div>
<table id="example" class="display" style="width: 100%"></table>
</div>
You can add data using javascript for testing.
For example, "var dt" equals to
[
{
"id": "1",
"EmployeeName": "Tiger Nixon",
"Designation": "Manager",
"Department": "IT"
},
{
"id": "2",
"EmployeeName": "Garrett Winters",
"Designation": "Head",
"Department": "Account"
},
{
"id": "3",
"EmployeeName": "Ashton Cox",
"Designation": "CIO",
"Department": "Admin"
},
{
"id": "4",
"EmployeeName": "Cedric Kelly",
"Designation": "Director IT",
"Department": "IT"
},
{
"id": "5",
"EmployeeName": "Airi Satou",
"Designation": "CEO",
"Department": "Admin"
},
{
"id": "6",
"EmployeeName": "Bradley Greer",
"Designation": "Engineer",
"Department": "IT"
}];
And the JS codes are as this:
Result:
Best regards,
Sean
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.