function createTable(filteredData){
    
    // Select the table element by id
    var table = d3.select("#ufo-table");

    // Select the tbody element by id 
    var tbody = table.select("tbody");
    var trow;

    // Sets the table to it's default blank setting for population
    tbody.html("");

    // Loop through each object and append the data to the table
    filteredData.forEach(function(dataObject){
        // Create new row for each object
        trow = tbody.append("tr");
        trow.append("td").text(dataObject.datetime);
        trow.append("td").text(dataObject.city);
        trow.append("td").text(dataObject.state);
        trow.append("td").text(dataObject.country);
        trow.append("td").text(dataObject.shape);
        trow.append("td").text(dataObject.durationMinutes);
        trow.append("td").text(dataObject.comments);

    });

}
// Function to create and append data to the table
Function to create and append data to the table
Function to create and append data to the table
function createTable(filteredData){
    var table = d3.select("#ufo-table");
    var tbody = table.select("tbody");
    var trow;
    tbody.html("");
    filteredData.forEach(function(dataObject){
        trow = tbody.append("tr");
        trow.append("td").text(dataObject.datetime);
        trow.append("td").text(dataObject.city);
        trow.append("td").text(dataObject.state);
        trow.append("td").text(dataObject.country);
        trow.append("td").text(dataObject.shape);
        trow.append("td").text(dataObject.durationMinutes);
        trow.append("td").text(dataObject.comments);
    });
}
function createTable ( filteredData ) { var table = d3 . select ( "#ufo-table" ) ; var tbody = table . select ( "tbody" ) ; var trow ; tbody . html ( "" ) ; filteredData . forEach ( function ( dataObject ) { trow = tbody . append ( "tr" ) ; trow . append ( "td" ) . text ( dataObject . datetime ) ; trow . append ( "td" ) . text ( dataObject . city ) ; trow . append ( "td" ) . text ( dataObject . state ) ; trow . append ( "td" ) . text ( dataObject . country ) ; trow . append ( "td" ) . text ( dataObject . shape ) ; trow . append ( "td" ) . text ( dataObject . durationMinutes ) ; trow . append ( "td" ) . text ( dataObject . comments ) ; } ) ; }
Function to create and append data to the table
Function to create and append data to the table
// Select the table element by id // Select the tbody element by id  // Sets the table to it's default blank setting for population // Loop through each object and append the data to the table // Create new row for each object