HTML and CSS Reference
In-Depth Information
To Create a Table with Borders and Insert Text
Creating the table shown in Figure 4-28a involves first creating a table with three columns and five rows.
The first row of the table is for column headings; the other rows are for data. As you have learned, table heading
cells <th> differ from data cells <td> in their appearance. Text in a heading cell appears as bold and centered, while
text in a data cell appears as normal and left-aligned. In the external style sheet stylesch4.css that you created in an
earlier section of the project, you gave table header cells a background color of #757775 and white text. Table 4-9
contains the HTML tags and text used to create the table of golf options on the Golf Web page.
Table 4-9 HTML Code to Create a Table
Line
HTML Tag and Text
30
<table>
31
<tr>
32
<th >Activities</th>
33
<th>Days and Times</th>
34
<t h>Rates</th>
35
</tr>
36
37
<tr class=”stripe”>
38
<td>Regular play</td>
39
<td>Wednesday through Saturday, 7 a.m. - 5 p.m.</td>
40
<td>$40.00 per round</td>
41
</tr>
42
43
<tr>
44
<td>Shotgun play</td>
45
<td>Sundays 7 a.m. - 3 p.m.</td>
46
<td>$25.00 per round</td>
47
</tr>
48
49
<tr class=”stripe”>
50
<td>Private lessons</td>
51
<td>Sunday through Friday, 8 a.m. - 2 p.m.</td>
52
<td>$30.00 per hour</td>
53
</tr>
54
55
<tr>
56
<td>Group lessons</td>
57
<td>Mondays and Thursdays, 8 a.m. - noon</td>
58
<td>$20.00 per hour</td>
59
</tr>
60
</table>
61
62
</body>
63
</html>
Search WWH ::




Custom Search