I need to also append the table header dynamic as per the json array value using PHP. I am explaining my code below.
<?php
$resultArr=array(array("header"=>"Firstname","data"=>array("Jack","Ram")),array("header"=>"Lastname","data"=>array("Nayak","Das")),array("header"=>"Age","data"=>array("50","30")));
?>
<!doctype html>
<html>
<head>
<title>Demo Preview</title>
<meta name="robots" content="noindex, nofollow"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jack</td>
<td>Nayak</td>
<td>50</td>
</tr>
<tr>
<td>Ram</td>
<td>Das</td>
<td>30</td>
</tr>
</table>
</body>
</html>
Here I have the static values inside the table. I need to add the same values dynamically as per the array(i.e-$resultArr) using PHP.