To add <td id="value" in json data
Closed this issue · 1 comments
Brhmts commented
Hi
Firstly , Thanks for this amazing plugin, It saved lots of time
This is not an issue. Just I need some advice. How Could I get the td values ( <td id ="value") from each row and add it in JSON data ?
lightswitch05 commented
@Brhmts use extractor
feature.
$('table').tableToJSON({
extractor : function(cellIndex, $cell) {
// get id from the cell, if empty or non-existant, get the cell text
return $cell.attr('id') || $cell.text();
}
});