What is the best way of converting a Html table to datatable

前端 未结 2 1046
梦毁少年i
梦毁少年i 2021-02-03 12:34

I have a html table.I want to convert this into a datatable. What is the best way of doing so? Thanks

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-03 13:11

    ...some years later...

    var nodes = doc.DocumentNode.SelectNodes("//table/tr");
    

    line has a typo and needs to be with double forward slash after 'table' and everything works like a charm

    var nodes = doc.DocumentNode.SelectNodes("//table//tr");
    

提交回复
热议问题