title: How to refresh table after button click in ajax call?
body: <p>I have a table generated after ajax call success.When i re select the options and click on the button data added to existing table only.Here i want to refresh the table with updated table.Unable to set the the refresh functionality.For any help Thanks in advance. </p>
  
  <pre><code>function viewAttendanceSheet() {
      var date = $("#datepicker").val();
      $.ajax({
          type: 'GET',
          url: "attendanceList",
          dataType: "json",
          data: {
              "date": date
          },
          success: function(data, status) {
              alert(status);
              alert(JSON.stringify(data.length));
              var res = String(JSON.stringify(data)).split(",");
              if (data.length == 0) {
                  newRowContent = ("&lt;tr&gt;NOTHING TO DISPALY...&lt;/tr&gt;");
                  $("#ajaxViewAttendanceSheet").append(newRowContent);
              } else {
                  $("#attendanceViewTableHead").css("display", "block");
                  $.each(data, function(key, value) {
                      if (value.status == "Absent") {
                          newRowContent = ("&lt;tr&gt;&lt;td&gt;" + value.studentName + "&lt;/td&gt;&lt;td style=color:red;&gt;" + value.status + "**&lt;/td&gt;&lt;/tr&gt;");
                      } else {
                          newRowContent = ("&lt;tr&gt;&lt;td&gt;" + value.studentName + "&lt;/td&gt;&lt;td style=color:green;&gt;" + value.status + "&lt;/td&gt;&lt;/tr&gt;");
                      }
                      $("#ajaxViewAttendanceSheet").append(newRowContent);
                  });
              }
          }
      });
  }
  </code></pre>