Output a HTML table : HTML Table « HTML « PHP

Output a HTML table

<title>Table Example</title> 
    $Cars = array ("Ford","Dodge","Chevy"); 
    $CarId = array ("K","J","F"); 
    for($x=0; $x < count($Cars); $x++){ 
        print "<tr><td>$CarId[$x]</td>"; 
        print "<td>$Cars[$x]</td></tr>\n"; 

Related examples in the same category

1.Creating an HTML table from array elements
2.Use for each to loop through an array and create a table
3.Separate the city and state name in the array so we can total by state