[ Prev ]
2021-02-24

-- Feb 24 In-Class Exercise
 
 
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Grocery List</title>
    <style>
      table, th, td {
        border: 1px solid black;
        border-collapse: collapse;
        padding: 5px;
      }
    </style>
  </head>
  <body>
    <h2>Grocery List</h2>
    <table>
      <tr>
        <th>Item</th>
        <th>Price</th>
      </tr>
      <?php
        $groceries = ["apple" => 1, "soda" => 0.5, "chips" => 2, "sandwich" => 3];
        foreach ($groceries as $key => $value) {
          echo "<tr><td>$key</td><td>$$value</td></tr>";
        }
      ?>
    </table>
  </body>
</html> 
 
<pre> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Grocery List</title> <style> table, th, td { border: 1px solid black; border-collapse: collapse; padding: 5px; } </style> </head> <body> <h2>Grocery List</h2> <table> <tr> <th>Item</th> <th>Price</th> </tr> <?php $groceries = ["apple" => 1, "soda" => 0.5, "chips" => 2, "sandwich" => 3]; foreach ($groceries as $key => $value) { echo "<tr><td>$key</td><td>$$value</td></tr>"; } ?> </table> </body> </html> </pre>

-- Feb 24 In-Class Exercise
Resource Description for Screen Shot 2021-02-24 at 5.39.53 PM.png
 <!DOCTYPE html>
 <html lang="en"> 
 
 <head>
     <meta charset="UTF-8">
     <title>Grocery List</title>
     <style>
         table,
         td {
             padding: 5px;
             border: 1px solid black;
             border-collapse: collapse;
         } 
 
     </style>
 </head> 
 
 <body>
     <table>
         <caption>Grocery List</caption>
         <?php 
             $arr = ["Bananas" => 3, "Strawberries" => 6, "Blueberries" => 5]; 
 
             foreach($arr as $key => $value){
               echo "<tr><td>$key</td><td>$$value</td></tr>";
             }
        ?>
     </table>
 </body> 
 
 </html>
((resource:Screen Shot 2021-02-24 at 5.39.53 PM.png|Resource Description for Screen Shot 2021-02-24 at 5.39.53 PM.png)) <pre> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Grocery List</title> <style> table, td { padding: 5px; border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <table> <caption>Grocery List</caption> <?php $arr = ["Bananas" => 3, "Strawberries" => 6, "Blueberries" => 5]; foreach($arr as $key => $value){ echo "<tr><td>$key</td><td>$$value</td></tr>"; } ?> </table> </body> </html> </pre>

-- Feb 24 In-Class Exercise
 <!doctyle html>
 <html lang='en-US'>
 <head> <title>My Document</title>
 <meta charset="utf-8"/>
 <style>
	table, td {
		border: 1px solid black;
		border-collapse: collapse;
	} 
   </style>  </head>     <body>
	<table> 
		<caption>Grocery List</caption>
		<tr><td>Item</td><td>Price</td>
		<?php
			$grocery_list = ["bananas"=>4.38, "ketchup"=>1.99, "tofu"=>4.99];
			foreach($grocery_list as $item => $price) {
				echo "<tr><td>$item</td><td>$$price</td></tr>";
			}
		?>
	</table> 
   </body>     </html> (Edited: 2021-02-24)
<pre> <!doctyle html> <html lang='en-US'> <head> <title>My Document</title> <meta charset="utf-8"/> <style> table, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <table> <caption>Grocery List</caption> <tr><td>Item</td><td>Price</td> <?php $grocery_list = ["bananas"=>4.38, "ketchup"=>1.99, "tofu"=>4.99]; foreach($grocery_list as $item => $price) { echo "<tr><td>$item</td><td>$$price</td></tr>"; } ?> </table> </body> </html> </pre>

-- Feb 24 In-Class Exercise
<!DOCTYPE html> <html> <head>
 <style>
 table, th, td {
   border: 4px solid pink;
 }
 </style>
</head> <body>
<?php $cart = array("fat-free milk"=>4.99, "smoked salmon"=>8.99, "cilantro"=>0.99); ?>
<table>
 <tr>
     <th>Item</th>
     <th>Price</th>
 </tr>
 <?php
 foreach($cart as $item => $price) {
	 echo "<tr>";
   	 echo "<td>". $item ."</td>";
     echo "<td> $" . $price ."</td>";
	 echo "</tr>";
 }
 ?>
</table>
</body> </html>
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 4px solid pink; } </style> </head> <body> <?php $cart = array("fat-free milk"=>4.99, "smoked salmon"=>8.99, "cilantro"=>0.99); ?> <table> <tr> <th>Item</th> <th>Price</th> </tr> <?php foreach($cart as $item => $price) { echo "<tr>"; echo "<td>". $item ."</td>"; echo "<td> $" . $price ."</td>"; echo "</tr>"; } ?> </table> </body> </html>
2021-02-26

-- Feb 24 In-Class Exercise
Earl's Grocery List table, th, td { border: 1px solid black; border-collapse: collapse; }

Earl's Grocery List

<nowiki> <!DOCTYPE HTML> <html> <head><title>Earl's Grocery List</title></head> <meta charset="UTF-8"> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } </style> <body> <h1>Earl's Grocery List<. <table> <caption>Grocery List</caption> <?php $grocery_items = ["apple" => $5.00', "milk" => $3.50', "bread" => '$4.00']; foreach($grocery_items as $key => $value){ echo "<tr><td>$key</td><td>$value<td></tr>"; } ?> </table> </body> </html </nowiki>

-- Feb 24 In-Class Exercise
<!DOCTYPE html> <html lang="en-US"> <head>
    <title>Grocery Items</title> 
    <style>
        table, th, td {
          border: 1px solid black;
          border-collapse: collapse;
        }
    </style>
</head> <body>
    <table>
        <caption>Grocery Items</caption>
        <tr>
            <th>Item</th
            ><th>Cost</th>
        </tr>
        <?php 
        $grocery_items = ["Apple" => '$2.00', "Orange" => '$1.00', "Grapes" => '$5.00']; 
            foreach($grocery_items as $key => $value)
            {
                echo "<tr><td>$key</td><td>$value</td></tr>";
            }
        ?>
    </table>
</body> </html>
<!DOCTYPE html> <html lang="en-US"> <head> <title>Grocery Items</title> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <table> <caption>Grocery Items</caption> <tr> <th>Item</th ><th>Cost</th> </tr> <?php $grocery_items = ["Apple" => '$2.00', "Orange" => '$1.00', "Grapes" => '$5.00']; foreach($grocery_items as $key => $value) { echo "<tr><td>$key</td><td>$value</td></tr>"; } ?> </table> </body> </html>
2021-02-27

-- Feb 24 In-Class Exercise
<?php
$arr = ["Bread" => 3, "Milk" => 4, "Banana" => 1, "Pasta" => 2, "Cake" => 20];
?>
  <!doctype html> <html>
    <head>
        <title>exercise Feb 24</title>
        <meta charset="utf-8" />
        <style>
          table, th, td {
            border: 1px solid black;
            border-collapse: collapse;
          }
        </style>
    </head>
    <body>
        <table>
            <caption>Grocery</caption>
            <tr><th>Food</th><th>Price</th></tr>
            <?php
            foreach($arr as $key => $value){
              echo "<tr><td>$key</td><td>$$value</td></tr>";
            }//for
            ?>
          </table>
    </body>
    </html>
  <?php
(Edited: 2021-02-27)
<pre> <?php $arr = ["Bread" => 3, "Milk" => 4, "Banana" => 1, "Pasta" => 2, "Cake" => 20]; ?> <!doctype html> <html> <head> <title>exercise Feb 24</title> <meta charset="utf-8" /> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <table> <caption>Grocery</caption> <tr><th>Food</th><th>Price</th></tr> <?php foreach($arr as $key => $value){ echo "<tr><td>$key</td><td>$$value</td></tr>"; }//for ?> </table> </body> </html> <?php </pre>
2021-02-28

-- Feb 24 In-Class Exercise
<!DOCTYPE html>
<html>
    <head>
        <style>
            table, td, tr{
                border: 1px solid black;
                border-collapse: collapse;
            }
        </style>
    </head>
    <body>
        <table>
            <caption>Grocery List</caption>
            <tr><td>Item</td><td>Price</td></tr>
            <tr>
                <td>
                    <?php
                        $grocerylist = ["Tortillas" => 5.00, "Chicken" => 6.99, "Milk" => 4.69];
                            foreach($grocerylist as $item => $price){
                            echo "<tr><td>$item</td><td>$price</td></tr>";
                        }
                    ?>
                </td>
            </tr>
        </table>
    </body>
</html>
(Edited: 2021-02-28)
<pre> <!DOCTYPE html> <html> <head> <style> table, td, tr{ border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <table> <caption>Grocery List</caption> <tr><td>Item</td><td>Price</td></tr> <tr> <td> <?php $grocerylist = ["Tortillas" => 5.00, "Chicken" => 6.99, "Milk" => 4.69]; foreach($grocerylist as $item => $price){ echo "<tr><td>$item</td><td>$price</td></tr>"; } ?> </td> </tr> </table> </body> </html> </pre>

-- Feb 24 In-Class Exercise
table, th, td { border: 1px solid black; border-collapse: collapse; }

Foods to get

<nowiki><!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <h1>Foods to get</h1> <table> <?php $food = ["egg" => 1, "banana" => 1, "grapes" => 2]; foreach($food as $item => $price){ echo "<tr><td>$item</td><td>$price</td></tr>"; } ?> </table> </body> </html></nowiki>

-- Feb 24 In-Class Exercise
<!DOCTYPE html> <html>
 <head>
   <title>Grocery</title>
   <style>
     table, td{
       border: 1px solid black;
       border-collapse: collapse;
     }
   </style>
 </head>
 <body>
     <h1>Grocery</h1>
   <table> 
     <?php 
     $grocery = ["chicken"=>"7", "chili"=>"10", "gorgonzola"=>"4"];
     foreach($grocery as $key => $value){
       echo "<tr><td>$key</td><td>$$value</td></tr>";
     }
     ?>
   </table>
 </body>
 </html>
<!DOCTYPE html> <html> <head> <title>Grocery</title> <style> table, td{ border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <h1>Grocery</h1> <table> <?php $grocery = ["chicken"=>"7", "chili"=>"10", "gorgonzola"=>"4"]; foreach($grocery as $key => $value){ echo "<tr><td>$key</td><td>$$value</td></tr>"; } ?> </table> </body> </html>
[ Next ]
X