Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Scott Paterson
Scott Paterson
26,869 Points

Options for a Food menu

Hi People

I am making a food menu for a website it roughly has about 50 items with some variation in it, the menu is hot and cold food, the site has been made so far with HTML and CSS and a little PHP.

My question is any ideas how I could do the menu? I have made ones in the past with HTML and CSS should I do this again? or is there another fab way I could get it done or how you would do it? All the menu is for is to see the price of the items only.

Thanks in advance for any comments and help Scott :)

2 Answers

Jeremy Frimond
Jeremy Frimond
14,470 Points

@scott paterson If you have 50 items I would recommend using a table. When in doubt keep it simple aye with a table it can be styled as one unit.

If you want you can make it with php... if you want to go the extra mile (using arrays).

<tr>
  <td>Item</td>
  <td>Price</td> 
</tr>
<tr>
  <td>Eggs</td>
  <td>$5.00</td> 
</tr>
<tr>
  <td>Pancakes</td>
  <td>$7.00</td> 
</tr> ````

You can also make the table with Arrays

``` <?php
$goodeats = array();
$goodeats[0] = array(
    "name" => "Eggs & Bacon",
    "price" => 5,
);
$goodeats[1] = array(
    "name" => "Pancakes",
    "price" => 7,
); 

?> ```

Then incorporate the php into the HTML
Scott Paterson
Scott Paterson
26,869 Points

Hi Jeremy thank you for taking the time to reply, I think I will try both, starting with the HTML table just to get the site done, while I look into using PHP arrays I'll need to refresh my memory, but I really fancy trying this method out.

Jeremy Frimond
Jeremy Frimond
14,470 Points

Scott Paterson no worries buddy. I would fully recommend starting with a static HTML prototype, get it out on the web then convert to php. With a menu of 50, and growing I assume, management of your menu items and price will be easier to track and edit with php.

Best of luck!