Click here to Skip to main content
14,639,666 members
Rate this:
Please Sign up or sign in to vote.

I am using a webservice which return data as Json format, i want to bind the json data to a HTML table using javascript.

Json Webservice Output :-

[{"Address_Line_1":"331 Bangalore","Address_Line_2":"","Address_Line_3":"","Address_Line_4":"","AlternateAddresses":[],"City":"Bangalore","Country":"India","Distance":"0","FormattedAddress":"3s1 Bangalore, Bangalore, Bangalore 66","GeoCode":"POINT (-34.134345334349056 20.3254345354” }]

so how to bind the above json output to html table using javascript. and how to call this Json webservice in javascript how to handel output and how to bind to html data , a sample will be very helpful.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1


There are many ways you can do it. One way is to use document.createElement("<table">), document.createElement("<tr">) and document.createElement("<td">). You can then use .append method to append the td to tr and tr to table and finally table to either body or placehoder div.

However I will suggest you to have a look at Data Tables[^], SlickGrid[^] which offer's much more capabilities.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100