{"id":1671,"date":"2016-05-15T17:51:23","date_gmt":"2016-05-15T17:51:23","guid":{"rendered":"http:\/\/box.jharaphula.com\/?p=1671"},"modified":"2026-04-14T00:39:31","modified_gmt":"2026-04-14T06:09:31","slug":"data-json-to-html-table-php","status":"publish","type":"post","link":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/","title":{"rendered":"How to display data from JSON to HTML table using PHP?"},"content":{"rendered":"<p>JSON (<em>JavaScript Object Notation<\/em>) is a platform independent data inter-exchange technology. To bulid a JSON file we follow XML formatting. JavaScript program can easily convert JSON data into JavaScript objects. Like a database using <a href=\"https:\/\/jharaphula.com\/learn-json-tutorial-for-beginners\/\" target=\"_blank\" rel=\"noopener noreferrer\">JSON<\/a> we can store and retrieve data with multiple fields. In this demo app I am fetching a well formatted JSON file using PHP file_get_contents method. Then dynamically using html table, tr and td presenting those JSON records in a HTML Table.<\/p>\n<h2>Converting Data from JSON to HTML Tables<\/h2>\n<p>JSON is a lightweight data interchange format widely used for transmitting data between servers and web applications. HTML tables, on the other hand, provide a structured way to display data in rows and columns on a webpage. Converting JSON data into an HTML table is a common task in web development, enabling developers to present data in a readable and organized manner. This article explores various methods to achieve this conversion, including manual JavaScript approaches, using libraries, and leveraging modern frameworks.<\/p>\n<p>To start with first let me create a valid JSON file. In below JSON file for each node we have 4 fields empName, designation, company and mob. To present data using JSON we follow key, value pair. Curly braces hold objects while Square brackets hold arrays.<\/p>\n<h3>emp_records.json<\/h3>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">{&quot;employees&quot;:\r\n[\r\n{\r\n&quot;empName&quot;: &quot;Swati Nanda&quot;,\r\n&quot;designation&quot;: &quot;Project Manager&quot;,\r\n&quot;company&quot;: &quot;InfoSys&quot;,\r\n&quot;mob&quot;: &quot;9092353322&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Pravat Mishra&quot;,\r\n&quot;designation&quot;: &quot;English Trainer&quot;,\r\n&quot;company&quot;: &quot;FM College&quot;,\r\n&quot;mob&quot;: &quot;7847324432&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Divya Singh&quot;,\r\n&quot;designation&quot;: &quot;Sr. Content Writer&quot;,\r\n&quot;company&quot;: &quot;Wipro&quot;,\r\n&quot;mob&quot;: &quot;9625477893&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Baby Roy&quot;,\r\n&quot;designation&quot;: &quot;Graphic Engineer&quot;,\r\n&quot;company&quot;: &quot;Tech Mahindra&quot;,\r\n&quot;mob&quot;: &quot;9096266548&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Satyabrata Panda&quot;,\r\n&quot;designation&quot;: &quot;Sr. Software Engineer&quot;,\r\n&quot;company&quot;: &quot;Capgemini&quot;,\r\n&quot;mob&quot;: &quot;5567748833&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Sonam Singh&quot;,\r\n&quot;designation&quot;: &quot;Graphic Engineer&quot;,\r\n&quot;company&quot;: &quot;TCS&quot;,\r\n&quot;mob&quot;: &quot;8260272137&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Subash Roy&quot;,\r\n&quot;designation&quot;: &quot;Jr. Software Engineer&quot;,\r\n&quot;company&quot;: &quot;InfoSys BPO&quot;,\r\n&quot;mob&quot;: &quot;5237748822&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Mohini Mohapatra&quot;,\r\n&quot;designation&quot;: &quot;UI\/UX Engineer&quot;,\r\n&quot;company&quot;: &quot;Synechron&quot;,\r\n&quot;mob&quot;: &quot;8892978436&quot;\r\n},\r\n{\r\n&quot;empName&quot;: &quot;Supriti Kabi&quot;,\r\n&quot;designation&quot;: &quot;Sr. HTML Developer&quot;,\r\n&quot;company&quot;: &quot;InfoSys BPO&quot;,\r\n&quot;mob&quot;: &quot;6667748877&quot;\r\n}\r\n]\r\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/php-table-with-json-data.jpg\" alt=\"php-table-with-json-data\" width=\"754\" height=\"173\" class=\"alignnone size-full wp-image-1802\" srcset=\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/php-table-with-json-data.jpg 754w, https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/php-table-with-json-data-300x69.jpg 300w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/p>\n<p>Now create your PHP file with the below lines of Code.<\/p>\n<h3>JSON-to-HTML.php<\/h3>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\/*Fetching JSON file content using php file_get_contents method*\/\r\n$str_data = file_get_contents(&quot;emp-records.json&quot;);\r\n$data = json_decode($str_data, true);\r\n\r\n\/*Initializing temp variable to design table dynamically*\/\r\n$temp = &quot;&lt;table&gt;&quot;;\r\n\r\n\/*Defining table Column headers depending upon JSON records*\/\r\n$temp .= &quot;&lt;tr&gt;&lt;th&gt;Employee Name&lt;\/th&gt;&quot;;\r\n$temp .= &quot;&lt;th&gt;Designation&lt;\/th&gt;&quot;;\r\n$temp .= &quot;&lt;th&gt;Company&lt;\/th&gt;&quot;;\r\n$temp .= &quot;&lt;th&gt;Mobile Number&lt;\/th&gt;&lt;\/tr&gt;&quot;;\r\n\r\n\/*Dynamically generating rows &amp; columns*\/\r\nfor($i = 0; $i &lt; sizeof($data[&quot;employees&quot;]); $i++)\r\n{\r\n$temp .= &quot;&lt;tr&gt;&quot;;\r\n$temp .= &quot;&lt;td&gt;&quot; . $data[&quot;employees&quot;][$i][&quot;empName&quot;] . &quot;&lt;\/td&gt;&quot;;\r\n$temp .= &quot;&lt;td&gt;&quot; . $data[&quot;employees&quot;][$i][&quot;designation&quot;] . &quot;&lt;\/td&gt;&quot;;\r\n$temp .= &quot;&lt;td&gt;&quot; . $data[&quot;employees&quot;][$i][&quot;company&quot;] . &quot;&lt;\/td&gt;&quot;;\r\n$temp .= &quot;&lt;td&gt;&quot; . $data[&quot;employees&quot;][$i][&quot;mob&quot;] . &quot;&lt;\/td&gt;&quot;;\r\n$temp .= &quot;&lt;\/tr&gt;&quot;;\r\n}\r\n\r\n\/*End tag of table*\/\r\n$temp .= &quot;&lt;\/table&gt;&quot;;\r\n\r\n\/*Printing temp variable which holds table*\/\r\necho $temp;<\/pre>\n<p>Using the above PHP codes first I am reading the JSON file using file_get_contents() method. Then after using json_decode() method I am decoding the JSON data and storing in a variable like an Array. Temp is the variable which I used to generate dynamic html for table. Using string concatenation I am appending html and $data values to $temp. Finally using using echo I am printing the value of $temp.<\/p>\n<p>Inside the table to Create dynamic rows I am using a for loop over total records count. To get total record count here I am using sizeof() method against $data[&#8220;employees&#8221;] array. Then depending upon JSON records I am binding respective values to td&#8217;s for each row.<\/p>\n<h3>tblClasses.css<\/h3>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\/*Style for Table*\/\r\ntable, th , td {\r\nborder: 1px solid grey;\r\nborder-collapse: collapse;\r\npadding: 4px;\r\nfont-family: arial;\r\n}\r\n\/*Style for Table Header*\/\r\nth {\r\nbackground: darkblue;\r\ncolor: white;\r\ntext-align: left;\r\n}\r\n\/*Style for Alternate Rows*\/\r\ntable tr:nth-child(odd) {\r\nbackground-color: #C2EBC3;\r\n}\r\ntable tr:nth-child(even) {\r\nbackground-color: #FFFFFF;\r\n}<\/pre>\n<p>Without the above CSS code this demo app will run. But to make your HTML table beautiful this CSS classes can help. Just copy paste these classes under style tag. This will give you a table as shown in the above figure. You must noticed here I am using tr:nth-child(odd) and tr:nth-child(even) with different background colors. This CSS selector helps to distigush alternate rows with different color codes.<\/p>\n<h2>Best Practices<\/h2>\n<p>improper usage can lead to inefficiencies, security vulnerabilities, and poor user experiences. By following best practices, developers can ensure JSON is used effectively, optimizing performance, enhancing accessibility, and maintaining data integrity.<\/p>\n<p><strong>1. Validate JSON Data<\/strong><\/p>\n<p>Ensuring JSON data is correctly structured and free from errors is crucial for application stability.<\/p>\n<p>Use Schema Validation JSON Schema provides a standardized way to define the structure of JSON data. By validating incoming JSON against a schema, developers can catch malformed data early. Tools like AJV (Another JSON Schema Validator) for JavaScript or jsonschema for Python help enforce data integrity.<\/p>\n<p>Sanitize Inputs Malicious or malformed JSON can lead to security risks such as injection attacks. Always sanitize inputs before parsing. Libraries like DOMPurify for browser-based applications or custom validation logic can prevent unsafe data from being processed.<\/p>\n<p>Handle Parsing Errors Gracefully Use `try-catch` blocks when parsing JSON to manage errors without crashing the application. For example:<\/p>\n<p>javascript try { const data = JSON.parse(jsonString); } catch (error) { console.error(&#8220;Invalid JSON format:&#8221;, error); }<\/p>\n<p><strong>2. Optimize Performance<\/strong><\/p>\n<p>Efficient JSON usage reduces latency and improves application responsiveness.<\/p>\n<p>Minify JSON Removing unnecessary whitespace and line breaks reduces file size, speeding up transmission. Tools like JSON.stringify() with replacer functions or online minifiers can help.<\/p>\n<p>Use Compression For large JSON payloads, enable Gzip or Brotli compression on the server to minimize bandwidth usage. Most web servers (e.g., Nginx, Apache) support compression out of the box.<\/p>\n<p>Lazy Load Large Datasets Instead of loading entire JSON files at once, implement pagination or streaming for large datasets. For example, Node.js streams can process JSON data in chunks:<\/p>\n<p>javascript const fs = require(&#8216;fs&#8217;); const stream = fs.createReadStream(&#8216;large-data.json&#8217;); stream.on(&#8216;data&#8217;, (chunk) => processChunk));<\/p>\n<p>Cache JSON Responses Leverage browser caching (`Cache-Control` headers) or server-side caching (Redis, Memcached) to avoid redundant JSON fetches.<\/p>\n<p><strong>3. Enhance Accessibility<\/strong><\/p>\n<p>JSON should be structured to support assistive technologies and diverse user needs.<\/p>\n<p>Use Semantic Keys Choose descriptive key names that convey meaning. For example:<\/p>\n<p>json { &#8220;user&#8221;: { &#8220;name&#8221;: &#8220;John Doe&#8221;, &#8220;email&#8221;: &#8220;john@example.com&#8221; } }<\/p>\n<p>Instead of:<\/p>\n<p>json { &#8220;u&#8221;: { &#8220;n&#8221;: &#8220;John Doe&#8221;, &#8220;e&#8221;: &#8220;john@example.com&#8221; } }<\/p>\n<p>Support Localization Store multilingual content in a structured way for easy translation:<\/p>\n<p>json { &#8220;greeting&#8221;: { &#8220;en&#8221;: &#8220;Hello&#8221;, &#8220;es&#8221;: &#8220;Hola&#8221;, &#8220;fr&#8221;: &#8220;Bonjour&#8221; } }<\/p>\n<p>Provide Alternative Text for Media When JSON includes media references, include `altText` for screen readers:<\/p>\n<p>json { &#8220;image&#8221;: { &#8220;url&#8221;: &#8220;profile.jpg&#8221;, &#8220;altText&#8221;: &#8220;Profile picture of John Doe&#8221; } }<\/p>\n<p><strong>4. Responsive Design with JSON<\/strong><\/p>\n<p>JSON can dynamically adapt to different devices and screen sizes.<\/p>\n<p>Serve Conditional Data Return only necessary fields based on device type. For example, mobile clients may require fewer data points than desktop:<\/p>\n<p>json { &#8220;product&#8221;: { &#8220;id&#8221;: 123, &#8220;name&#8221;: &#8220;Smartphone&#8221;, &#8220;price&#8221;: 599, &#8220;mobile&#8221;: { &#8220;thumbnail&#8221;: &#8220;phone-sm.jpg&#8221; }, &#8220;desktop&#8221;: { &#8220;gallery&#8221;: [&#8220;phone-1.jpg&#8221;, &#8220;phone-2.jpg&#8221;] } } }<\/p>\n<p>Use Media Queries with JSON Frontend frameworks can conditionally render JSON data based on screen size:<\/p>\n<p>javascript const responsiveData = window.innerWidth < 768 ? mobileData : desktopData;\n\nOptimize for Low-Bandwidth Users Provide fallback JSON structures with reduced detail for slow connections:\n\njson { \"lowBandwidthMode\": true, \"essentialData\": { \"title\": \"Basic Content\", \"summary\": \"Simplified version for slow connections\" } }\n\n\n\n<h2>Conclusion<\/h2>\n<p>Converting JSON to HTML tables is a fundamental task in web development, facilitating the display of structured data on webpages. Whether using vanilla JavaScript, libraries, or frameworks, developers can choose the method that best suits their project requirements. By following best practices, the resulting tables will be efficient, accessible, and user-friendly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JSON (JavaScript Object Notation) is a platform independent data inter-exchange technology. To bulid a JSON file we follow XML formatting. JavaScript program can easily convert&#8230;<\/p>\n","protected":false},"author":3,"featured_media":1801,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[36987,39781,39780,39431,38694],"class_list":["post-1671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-demo-apps","tag-getjson-example","tag-html-table-using-php","tag-json-to-html-table","tag-script-for-php","tag-xml-to-html-table"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to display data from JSON to HTML table using PHP?<\/title>\n<meta name=\"description\" content=\"Like a database using JSON we can store and retrieve data. In this session I created a demo app to show you how to show JSON to HTML table using PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to display data from JSON to HTML table using PHP?\" \/>\n<meta property=\"og:description\" content=\"Like a database using JSON we can store and retrieve data. In this session I created a demo app to show you how to show JSON to HTML table using PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\" \/>\n<meta property=\"og:site_name\" content=\"OneStop Shop\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/tajinweb\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-15T17:51:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-14T06:09:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"434\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nibedita Panda\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nibedita Panda\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\"},\"author\":{\"name\":\"Nibedita Panda\",\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/person\/129213d91cdcccd8f9396797c56e7dc3\"},\"headline\":\"How to display data from JSON to HTML table using PHP?\",\"datePublished\":\"2016-05-15T17:51:23+00:00\",\"dateModified\":\"2026-04-14T06:09:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\"},\"wordCount\":1482,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/jharaphula.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png\",\"keywords\":[\"GetJSON Example\",\"HTML table using PHP\",\"JSON to HTML Table\",\"Script for PHP\",\"XML to HTML Table\"],\"articleSection\":[\"Learn PHP with Examples\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\",\"url\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\",\"name\":\"How to display data from JSON to HTML table using PHP?\",\"isPartOf\":{\"@id\":\"https:\/\/jharaphula.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png\",\"datePublished\":\"2016-05-15T17:51:23+00:00\",\"dateModified\":\"2026-04-14T06:09:31+00:00\",\"description\":\"Like a database using JSON we can store and retrieve data. In this session I created a demo app to show you how to show JSON to HTML table using PHP.\",\"breadcrumb\":{\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage\",\"url\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png\",\"contentUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png\",\"width\":750,\"height\":434,\"caption\":\"How to display data from JSON to HTML table using PHP?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jharaphula.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to display data from JSON to HTML table using PHP?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jharaphula.com\/#website\",\"url\":\"https:\/\/jharaphula.com\/\",\"name\":\"OneStop Shop\",\"description\":\"Blog for SEO Guest Posting, Digital Marketing or Home Remedies\",\"publisher\":{\"@id\":\"https:\/\/jharaphula.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jharaphula.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jharaphula.com\/#organization\",\"name\":\"OneStop Shop\",\"url\":\"https:\/\/jharaphula.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg\",\"contentUrl\":\"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg\",\"width\":409,\"height\":91,\"caption\":\"OneStop Shop\"},\"image\":{\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/tajinweb\",\"https:\/\/x.com\/guestpostingopp\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/jharaphula.com\/#\/schema\/person\/129213d91cdcccd8f9396797c56e7dc3\",\"name\":\"Nibedita Panda\",\"description\":\"Mrs. Nibedita is a housewife. She is passionate about to write various information's depending upon the growing market trend. In our unit she takes care of many major releases. Her contribution is most valued for us.\",\"sameAs\":[\"https:\/\/jharaphula.com\"],\"url\":\"https:\/\/jharaphula.com\/author\/nibeditap\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to display data from JSON to HTML table using PHP?","description":"Like a database using JSON we can store and retrieve data. In this session I created a demo app to show you how to show JSON to HTML table using PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/","og_locale":"en_US","og_type":"article","og_title":"How to display data from JSON to HTML table using PHP?","og_description":"Like a database using JSON we can store and retrieve data. In this session I created a demo app to show you how to show JSON to HTML table using PHP.","og_url":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/","og_site_name":"OneStop Shop","article_publisher":"https:\/\/www.facebook.com\/tajinweb","article_published_time":"2016-05-15T17:51:23+00:00","article_modified_time":"2026-04-14T06:09:31+00:00","og_image":[{"width":750,"height":434,"url":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png","type":"image\/png"}],"author":"Nibedita Panda","twitter_misc":{"Written by":"Nibedita Panda","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#article","isPartOf":{"@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/"},"author":{"name":"Nibedita Panda","@id":"https:\/\/jharaphula.com\/#\/schema\/person\/129213d91cdcccd8f9396797c56e7dc3"},"headline":"How to display data from JSON to HTML table using PHP?","datePublished":"2016-05-15T17:51:23+00:00","dateModified":"2026-04-14T06:09:31+00:00","mainEntityOfPage":{"@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/"},"wordCount":1482,"commentCount":4,"publisher":{"@id":"https:\/\/jharaphula.com\/#organization"},"image":{"@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage"},"thumbnailUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png","keywords":["GetJSON Example","HTML table using PHP","JSON to HTML Table","Script for PHP","XML to HTML Table"],"articleSection":["Learn PHP with Examples"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jharaphula.com\/data-json-to-html-table-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/","url":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/","name":"How to display data from JSON to HTML table using PHP?","isPartOf":{"@id":"https:\/\/jharaphula.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage"},"image":{"@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage"},"thumbnailUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png","datePublished":"2016-05-15T17:51:23+00:00","dateModified":"2026-04-14T06:09:31+00:00","description":"Like a database using JSON we can store and retrieve data. In this session I created a demo app to show you how to show JSON to HTML table using PHP.","breadcrumb":{"@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jharaphula.com\/data-json-to-html-table-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#primaryimage","url":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png","contentUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2016\/05\/html-table.png","width":750,"height":434,"caption":"How to display data from JSON to HTML table using PHP?"},{"@type":"BreadcrumbList","@id":"https:\/\/jharaphula.com\/data-json-to-html-table-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jharaphula.com\/"},{"@type":"ListItem","position":2,"name":"How to display data from JSON to HTML table using PHP?"}]},{"@type":"WebSite","@id":"https:\/\/jharaphula.com\/#website","url":"https:\/\/jharaphula.com\/","name":"OneStop Shop","description":"Blog for SEO Guest Posting, Digital Marketing or Home Remedies","publisher":{"@id":"https:\/\/jharaphula.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jharaphula.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jharaphula.com\/#organization","name":"OneStop Shop","url":"https:\/\/jharaphula.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/","url":"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg","contentUrl":"https:\/\/jharaphula.com\/wp-content\/uploads\/2023\/10\/logo.jpg","width":409,"height":91,"caption":"OneStop Shop"},"image":{"@id":"https:\/\/jharaphula.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/tajinweb","https:\/\/x.com\/guestpostingopp"]},{"@type":"Person","@id":"https:\/\/jharaphula.com\/#\/schema\/person\/129213d91cdcccd8f9396797c56e7dc3","name":"Nibedita Panda","description":"Mrs. Nibedita is a housewife. She is passionate about to write various information's depending upon the growing market trend. In our unit she takes care of many major releases. Her contribution is most valued for us.","sameAs":["https:\/\/jharaphula.com"],"url":"https:\/\/jharaphula.com\/author\/nibeditap\/"}]}},"_links":{"self":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/posts\/1671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/comments?post=1671"}],"version-history":[{"count":0,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/posts\/1671\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/media\/1801"}],"wp:attachment":[{"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/media?parent=1671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/categories?post=1671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jharaphula.com\/wp-json\/wp\/v2\/tags?post=1671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}