Loop through DataTables table to get all cells content

后端 未结 4 1533
北恋
北恋 2021-02-04 01:21

I am using jquery dataTables to generate the paginated table on my site. I need to run a process that grabs all of the data out of a particular column. Something like :

<
4条回答
  •  迷失自我
    2021-02-04 02:14

    To access all the rows, you can do:

    var rows = $("#myTable").dataTable().fnGetNodes();
    

    In your case, this should work:

       $('.testLink').click(function(){
            var cells = [];
            var rows = $("#myTable").dataTable().fnGetNodes();
            for(var i=0;i

提交回复
热议问题