I have a table that is generated using JSON:
<div id="divResult" ></div>
The JSON script :
$.getJSON("@Url.Content("~/CadLevVisCont/ProcessaLevantamento")", { nmUF: catUF, nmRodovia: catRod, nmAno: catData }, function (data) {
$("#divResult").empty();
//Adicionar a tabela na div
table = "<table id='tableResult' class='table table-striped'><thead><tr><th >UF</th>";
table += "<th>BR</th><th >Cod. Levantamento</th><th>Sentido</th><th>km Inicial</th><th>km Final</th><th>Área Quebra de Bordo</th><th>Quantidade de Panelas</th>";
table += "<th>Trincamento</th><th>Trincamento Largo</th><th>Desgaste</th><th>IGG</th><th>ICS</th><th>Data do Levantamento</th><th>Obs</th></tr></thead></table>";
$("#divResult").append(table);
$(eval(data)).each(function (data) {
$("#tableResult").append("<tr ><td>"
+ this.rUF + "</td><td >"
+ this.rBR + "</td><td >"
+ this.rCodLev + "</td><td >"
+ this.rSentido + "</td><td>"
+ this.rkmIni + "</td><td>"
+ this.rkmFim + "</td><td>"
+ this.rAreaQuebraBordo + "</td><td>"
+ this.rQtdPanelas + "</td><td>"
+ this.rPercet+ "</td><td>"
+ this.rPercetLargo + "</td><td>"
+ this.rDesgaste + "</td><td>"
+ this.rIgg + "</td><td>"
+ this.rIcs + "</td><td>"
+ this.rData + "</td><td>"
+ this.rObs + "</td></tr>");
});
});
How can I make the table title fixed and data can be viewed through a scroll bar?