JS datatable logic

by moorthy28sep

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DataTable Example</title>
    <!-- Include jQuery -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <!-- Include DataTables CSS and JS -->
    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">
    <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
</head>
<body>
    <table id="meds-condition" tabindex="-1"
           class="table--base js-datatable js-table--sorting js-datatable--pagination dataTable no-footer"
           data-page-length="25" data-sZeroRecords='No information available'
           data-sort-order='[
               [[0, "asc"],[3, "desc"]],
               [[1, "asc"],[3, "desc"],[0, "asc"]],
               [[3, "asc"],[0, "asc"]],
               [[3, "asc"],[0, "asc"]]
           ]'>
        <thead>
            <tr>
                <th class="cell-width-45p">Name</th>
                <th class="cell-width-15p table__colnosort">Date of Onset</th>
                <th class="cell-width-25p table__colnosort">Source Author</th>
                <th class="cell-width-15p">Document Date</th>
            </tr>
        </thead>
        <tbody>
            <!-- Example rows, replace these with your actual data -->
			<tr data-href="javascript:void(0);" data-doctype="100.16645" data-sly-test.repoIdHypenDocId="2-2" data-sly-test.repoIdSlashDocId="2/2">
                <td data-th="Name" class="cell-width-16p">Condition 2</td>
                <td data-th="Date of Onset" data-sort="13-Feb-2024" class="cell-width-16p">13-Feb-2024</td>
                <td data-th="Source Author" class="cell-width-16p">Author 2</td>
                <td data-th="Document Date" data-sort="15-Feb-2023" class="cell-width-16p">15-Feb-2023</td>
            </tr>
            
			
			<tr data-href="javascript:void(0);"...