I am using datatables ( http://datatables.net/ ) to create a table with JSON, and I have the code:
<script type="text/javascript"> $(document).ready(function() { $('#example').dataTable( { "ajax": "objects.txt", "columns": [ { "data": "name" }, { "data": "position" }, { "data": "office" }, { "data": "extn" }, { "data": "start_date" }, { "data": "salary" } ] } ); } ); </script> <div class="container"> <table id="example" class="table table-striped table-bordered table-responsitive" cellspacing="0" width="100%"> <thead> <tr> <th>DAN</th> <th>Aktivnost</th> <th>Vreme</th> <th>Rashodi</th> <th>Prihodi</th> <th>Beleske</th> </tr> </thead> <tfoot> <tr> <th>DAN</th> <th>Aktivnost</th> <th>Vreme</th> <th>Rashodi</th> <th>Prihodi</th> <th>Beleske</th> </tr> </tfoot> </table> </div>
How can I get the row name and column name when I click on any cell? Also how to get row id and column id when clicking on a cell in a table?
source share