Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 2-Apr-13 19:01pm

1 solution

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

Solution 1

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,
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 3 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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