Loop through DataTables table to get all cells content

后端 未结 4 1534
北恋
北恋 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:07

    You'll want to use the "EQ" selector. It starts at the index of "0", so if you have..

    
      0
      1
      2
      3
    
    

    Then by using

     $("td").eq(3); // last one
     $("td").eq(2); //returns "2"
    

    Make sense?

    http://api.jquery.com/eq-selector/

提交回复
热议问题