JSFiddle - React, Tailwind, and code Playground

by BakBaka7a

HTML

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
</head>
<body>
    <table id="medicalDevicesTable" class="display">
        <thead>
            <tr>
                <th>No</th>
                <th>Device Name</th>
                <th>Company</th>
                <th>Origin</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1</td>
                <td>Electrocardiogram</td>
                <td>Philips</td>
                <td>Netherlands</td>
            </tr>
            <tr>
                <td>2</td>
                <td>MRI Machine</td>
                <td>GE Healthcare</td>
                <td>United States</td>
            </tr>
            <tr>
                <td>3</td>
                <td>Insulin Pump</td>
                <td>Medtronic</td>
                <td>Ireland</td>
            </tr>
            <tr>
                <td>4</td>
                <td>Ultrasound Machine</td>
                <td>Siemens Healthineers</td>
                <td>Germany</td>
            </tr>
            <tr>
                <td>5</td>
                <td>Ventilator</td>
                <td>Hamilton Medical</td>
                <td>Switzerland</td>
            </tr>
            <tr>
                <td>6</td>
                <td>Hematology</td>
                <td>Beckman Coulter</td>
                <td>United States</td>
            </tr>

        </tbody>
    </table>



</body>
</html>

JavaScript

$(document).ready(function() {
	
	
        var alternatives = {
            'United States': 'usa america united states of america',
            'Hematology': 'Hematology cbc',
        };
        $('#medicalDevicesTable').DataTable({
            columnDefs: [
                {
                    targets: '_all',
                    render: function(data, type, row) {
                        if (type === 'filter') {
                            if (alternatives.hasOwnProperty(data)) {
                                return alternatives[data];
                            }
                            return data;
                        }
                        return data;
                    }
                }
            ]
        });
		
		
    });