based on drop down i m displaying table using ajax jquery call.while i m selecting drop down list table is displaying but every cells showing [object Object] instead of data's
function generateTable(json) {
var $table = $('#tblDynamic');
$table.find('thead').empty()
$table.find('tbody').empty()
if (json && json.length > 0) {
var header = json[0];
var columns = [];
for (var col in header) {
columns.push('<th>' + col + '</th>');
}
$table.find('thead').append('<tr>' + columns.join('') + '</tr>');
var rows = [];
for (var i = 0; i < json.length; i++) {
var row = json[i];
var tds = [];
for (var col in row) {
tds.push('<td>' + row + '</td>');
}
rows.push('<tr>' + tds.join() + '</tr>');
}
$table.find('tbody').append(rows.join(''));
}
}