dashboard/static/js/sroutes.js
//build table using JSON data in jquery
build table using JSON data in jquery
build table using JSON data in jquery
function build_table(data,tb_id){
    var table = $(tb_id)
    console.log(table)
    $(".data-row").empty()
    for(var i = 0;i < data.length; i++){
        console.log(data[i]);
        var row = $("<tr>",{class: "data-row"});
        for(var j = 0; j < data[i].length; j++){
            var cell = $("<td>", {align:"center",valign:"middle"}).text(data[i][j]);
            console.log(data[i][j])
            row.append(cell)
        }
        table.append(row)
    }
}
function build_table ( data , tb_id ) { var table = $ ( tb_id ) console . log ( table ) $ ( ".data-row" ) . empty ( ) for ( var i = 0 ; i < data . length ; i ++ ) { console . log ( data [ i ] ) ; var row = $ ( "<tr>" , { class : "data-row" } ) ; for ( var j = 0 ; j < data [ i ] . length ; j ++ ) { var cell = $ ( "<td>" , { align : "center" , valign : "middle" } ) . text ( data [ i ] [ j ] ) ; console . log ( data [ i ] [ j ] ) row . append ( cell ) } table . append ( row ) } }
build table using JSON data in jquery
build table using JSON data in jquery