Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI,

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.
Posted

1 solution

Hello,

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.

Regards,
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900