I have this other code..
Still, can't get the output right..
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
$sushi = array(
'Fresh Tuna Sushi' => array (
'Fresh Tuna Fillet' => '8 ounces',
'Sushi Rice' => '2 cups',
'Wasabi Paste' => '2 tablespoons'
),
'Shrimp Sushi' => array (
'Large Shrimps' => '10 pieces',
'Vinegar' => '2 tablespoons',
'Sushi Rice' => '2 cups',
'Wasabi Paste' => '2 tablespoons',
),
'Nori Crab Sushi' => array (
'Nori Seaweeds' => '4 sheets',
'Crabmeat' => '8 ounces',
'Cream Cheese' => '8 ounces',
'Worcestershire Sauce' => '3/4 teaspoon',
'Garlic Salt' => '1/4 teaspoon'
),
'Vegetarian Sushi' => array (
'Rice Vinegar' => '1/2 cup',
'Sesame Oil' => '2 tablespoons',
'Nori Seaweeds' => '4 sheets',
'Sushi Rice' => '2 cups',
'Cucumber Strips' => '1 cup',
'Sweet Potatoes' => '1 cup',
'Sesame Seeds' => '2 tablespoon'
),
'California Roll Sushi' => array (
'Sushi Rice' => '1 cup',
'Nori Seaweeds' => '8 sheets',
'Sesame Seeds' => '2 tablespoons',
'Crabmeat' => '1/2 cup',
'Mayonnaise' => '3 tablespoons',
'Avocado' => '1 piece',
'Cucumber Strips' => '1/2 cup'
)
);
/* foreach($sushi as $type => $value){ //faster than for loop
foreach($value as $ingredients => $measurement){
echo '<br/>' . $type . '-' . $ingredients . '=>' . $measurement .
'</br>';
}
}*/
?>
<table border="1">
<tr>
<th>Sushi</th>
<th colspan="2">Ingredients</th>
</tr>
<?php
foreach ($sushi as $type => $ingredients){
?>
<tr>
<td rowspan="<?php echo count($sushi[$ingredients]) + 1; ?>" colspan="2"> <?php echo $type; ?> </td>
<td><?php
foreach ($ingredients as $name => $meas){
echo $name . '</br>';
}
?></td>
<td><?php
foreach ($ingredients as $name => $meas){
echo $meas . '</br>';
}
?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>