Convert JSON data to HTML table using JavaScript

Here's the JSON data. You can edit the below JSON array and convert it to an HTML <table>.

[
    {
        "Book ID": "1", 
        "Book Name": "Computer Architecture",
        "Category": "Computers",
        "Price": "125.60"
    },
    {
        "Book ID": "2",
        "Book Name": "Asp.Net 4 Blue Book",
        "Category": "Programming",
        "Price": "56.00"
    },
    {
        "Book ID": "3",
        "Book Name": "Popular Science",
        "Category": "Science",
        "Price": "210.40"
    }
]

Check whether the above JSON is valid or not.

Click the button to create an HTML <table> using the above JSON data.

See another example: How to add JSON data to a DIV element using pure JavaScript

Go back to the Tutorial
More interesting and interactive Demos