After Ajax gets the data append append to the table the appended data is different from the table style error:
$ ("#courierTable"). Append ("<tr style= ' text-align:center ' > class= ' tab-content '") $ ("#courierTable") . Append ("<tr style= ' text-align:center ' > class= ' tab-content '") $ ("#courierTable"). Append ("<td style= ' text-align:center ' > ' +obj[i].staffid+ ' </td> ') $ ("#courierTable"). Append ("<td>" + Obj[i].name+ "</td>")$("#courierTable"). Append ("<td>" +obj[i].comapny+ "</td>") $ ( "#courierTable"). Append ("<td>" +obj[i].registerdate+ "</td>")$ ("#courierTable"). Append ("<td>asdads</td>")$("#courierTable"). Append ("</tr>")$("#courierTable"). Append (content)
The format that appears is:
The reason is because the Append function requires a closed complete label, cannot output a TR first, and then outputs a few TD to finally close the TR. Corrected as follows:
Content = "<tr style= ' text-align:center ' > class= ' tab-content '" + "<td style= ' Text-align:center ' >" +obj[i]. Staffid+ "</td>" + "<td>" +obj[i].name+ "</td>" + "<td>" +obj[i].comapny+ "</td>" + "<TD > "+obj[i].registerdate+" </td> "+" <td>asdads</td> "+" </tr> "; $ (" #courierTable " ). Append (content)
The effect is as follows:
After Ajax gets the data, append appends to the table and there is a malformed error