JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css">
<table id="daytuh">
<thead>
<tr>
<th>Location</th>
<th>Names</th>
<th>Number</th>
<th>Description</th>
</tr>
</thead>
<tr>
<td>Queensland</td>
<td>Ezra Campos</td>
<td>16291006 3284</td>
<td>But some of them look like this</td>
</tr>
<tr>
<td>New South Wales</td>
<td>Nissim Jenkins</td>
<td>16001019 3845</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>New South Wales</td>
<td>Fuller Sparks</td>
<td>16830728 1579</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>Victoria</td>
<td>Anthony Mathews</td>
<td>16830517 5302</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>New South Wales</td>
<td>Yardley Pennington</td>
<td>16571005 3462</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>Australian Capital Territory</td>
<td>Jesse Calhoun</td>
<td>16680306 4911</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>Queensland</td>
<td>Xenos Walton</td>
<td>16271221 0273</td>
<td>But some of them look like this</td>
</tr>
<tr>
<td>New South Wales</td>
<td>Ivan Phelps</td>
<td>16471111 6360</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>South Australia</td>
<td>Orson Sykes</td>
<td>16721211 9965</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>New South Wales</td>
<td>Lamar Simpson</td>
<td>16520211 3113</td>
<td>Most of the descriptions look like this </td>
</tr>
<tr>
<td>New South Wales</td>
<td>Sebastian Hampton</td>
<td>16171022 3999</td>
<td>Most of the descriptions look like this...
JavaScript
$('#daytuh').DataTable({
'rowGroup': {
startRender: function (rows,group ) {
// Get the data of the first row in the group.
var firstRowData = rows.data().eq(0);
return group + ' - ' + firstRowData[3];
},
dataSrc: [0],
},
columnDefs: [{
targets: [0, 3],
visible: false,
}, ],
paging: false
});