JSFiddle - React, Tailwind, and code Playground

HTML

<script type="text/javascript">
                       
    $(document).ready(function(){
        $('#example tbody').on( 'click', 'td', function () {
            alert('Data:'+$(this).html().trim());
            alert('Row:'+$(this).parent().find('td').html().trim());
            alert('Column:'+$('#example thead tr th').eq($(this).index()).html().trim());
        });
    });

</script>



<table cellspacing="0" width="100%" class="display nowrap dataTable dtr-inline" id="example"
        role="grid" aria-describedby="example_info" style="width: 100%;">
        <thead>
            <tr role="row">
                <th class="sorting_asc" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                    style="width: 133px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">
                    Name
                </th>
                <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                    style="width: 224px;" aria-label="Position: activate to sort column ascending">
                    Position
                </th>
                <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                    style="width: 100px;" aria-label="Office: activate to sort column ascending">
                    Office
                </th>
                <th class="dt-body-right sorting" tabindex="0" aria-controls="example" rowspan="1"
                    colspan="1" style="width: 41px;" aria-label="Age: activate to sort column ascending">
                    Age
                </th>
                <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                    style="width: 92px;" aria-label="Start date: activate to sort column ascending">
                    Start date
                </th>
                <th class="dt-body-right sorting" tabindex="0" aria-controls="example" rowspan="1"
                    colspan="1"...

CSS

#example tbody tr td{ border:1px solid black}