Created
October 22, 2012 16:34
-
-
Save psibi/3932397 to your computer and use it in GitHub Desktop.
Build table using jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jobject = $(html_response_data); | |
$("caption.featureInfo",jobject).remove(); //Removing Caption tag | |
var mytable = "<table class=\"featureInfo\"><thead>"; | |
var trs = $('tr',jobject); | |
trs.each(function(i,n) { //console.log($(n).html()); | |
if (i==0) { mytable += $(n).html(); mytable += "</thead><tbody>";} | |
else { mytable += "<tr>"; mytable +=$(n).html(); mytable += "</tr>";} | |
}); | |
mytable += "</tbody></table>"; | |
$('#nodelist').html(mytable); //Put the table in the div whose id is "nodelist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment