-- Feb 24 In-Class Exercise
Insert non-formatted text here
<!DOCTYPE html>
<html>
<head>
<title>exercise 3-3</title>
<style>
table, th, td {
border: 1px solid black; width: 30%;
}
</style>
</head>
<body>
<h2>Grocery List</h2>
<?php
$items = ["Bananas"=>"$2.00", "Milk"=>"$5.00", "Whey"=>"$25.00"];
?>
<table>
<tr>
<th>Item</th>
<th>Price</th>
</tr>
<?php
foreach($items as $item => $price) {
echo "<tr><td>$item</td><td>$price</td></tr>";
}
?>
</table>
</body>
</html>
<nowiki>Insert non-formatted text here</nowiki>
<!DOCTYPE html>
<html>
<head>
<title>exercise 3-3</title>
<style>
table, th, td {
border: 1px solid black; width: 30%;
}
</style>
</head>
<body>
<h2>Grocery List</h2>
<?php
$items = ["Bananas"=>"$2.00", "Milk"=>"$5.00", "Whey"=>"$25.00"];
?>
<table>
<tr>
<th>Item</th>
<th>Price</th>
</tr>
<?php
foreach($items as $item => $price) {
echo "<tr><td>$item</td><td>$price</td></tr>";
}
?>
</table>
</body>
</html>