<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
PHP arrays
Author: Elena Machkasova elenam@morris.umn.edu
Last modified: 2/21/06
-->
<?php
// DO NOT CHANGE THE ORDER OF ELEMENTS IN THESE ARRAYS
$colors = array("red", "orange", "yellow");
$fruit = array("apple", "orange", "banana");
$td_style = "width: 75px; height: 30px; text-align: center";
?>
<html>
<head>
<title>
Using arrays to generate a table
</title>
</head>
<body>
<h3>What would you like for breakfast?</h3>
</body>
</html>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Author: Elena Machkasova elenam@morris.umn.edu
Last modified: 2/25/06
-->
<?php
$students = array("Joe Smith", "Jane Brown", "Bob Green",
"Julia Anderson", "Mary Andrews",
"Peter Black");
$scores = array("Joe Smith" => 75, "Jane Brown" => 88,
"Bob Green" => 96, "Julia Anderson" => 93.5,
"Mary Andrews" => 67, "Peter Black" => 89);
?>
<html>
<head>
<title>
Homework Question 2
</title>
</head>
<body>
<h2>Grade list</h2>
</body>
</html>
Question 2.1 Write a program that creates a table
with one row per student, the student's name in one column and their
grade in the other column. Test the program and save it away before
moving on to the next question.
$colors = array("lightgreen", "darkgreen");
The program draws a checker board as a table, alternating the cell
background between the two colors. A checker board is 8-by-8 squares,
starting with the lighter color as the top left cell. Make sure that
the table cells are squares (i.e. you need to set width and height).
This page is a part of CSci 1101 course web site.