I want to convert the data of a html table into json set its key.
var tbl = $('#table-availed-prod tr').map(function () {
return $(this).find('td').map(function () {
return $(this).html();
}).get();
}).get();
What I get is this
JSON :
OR
Array(){
0: "Sophos"
1: "Complementary"
2: "Codey Ropen"
}
What I need is something like this
JSON :
[{
Productname:"Sophos",
ProductTypename:"Software",
AssignedPerson:"Codey"
},
{
Productname:"Sophos",
ProductTypename:"Software",
AssignedPerson:"Codey"
},
{
Productname:"Sophos",
ProductTypename:"Software",
AssignedPerson:"Codey"
}]