0% found this document useful (0 votes)
41 views

HTML - Tables

This document discusses HTML tables and provides examples of how to code different types of tables using HTML tags. It defines the <table>, <tr>, <th>, and <td> tags. It then gives examples of a basic table, a table with columns that span multiple rows, a table with rows that span multiple columns, and a table with a caption. The purpose is to teach how to structure data into tables using HTML for web design and online journalism.

Uploaded by

mz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
41 views

HTML - Tables

This document discusses HTML tables and provides examples of how to code different types of tables using HTML tags. It defines the <table>, <tr>, <th>, and <td> tags. It then gives examples of a basic table, a table with columns that span multiple rows, a table with rows that span multiple columns, and a table with a caption. The purpose is to teach how to structure data into tables using HTML for web design and online journalism.

Uploaded by

mz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 7

Web Design and Online

Journalism

Lecture 04 - HTML
CENTRE OF MEDIA STUDIES, ART AND DESIGN
SHIZA NISAR
Table
An HTML table is defined with the <table> tag.

Each table row is defined with the <tr> tag.

A table header is defined with the <th> tag.

By default, table headings are bold and centered.

A table data/cell is defined with the <td> tag.


Task 1: HTML Table
<table width="500" border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>80</td>
</tr>
</table>
Task 2: HTML Table - Cells that Span Many Columns
<table width="500" border="1">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>55577854</td>
<td>55577855</td>
</tr>
</table>
Task 3: HTML Table - Cells that Span Many Rows
<table width="500" border="1">
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th rowspan="2">Telephone:</th>
<td>55577854</td>
</tr>
<tr>
<td>55577855</td>
</tr>
</table>
Task 4: HTML Table – Adding a Caption
<table width="500" border="1">
<caption>Monthly savings</caption>
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th rowspan="2">Telephone:</th>
<td>55577854</td>
</tr>
<tr>
<td>55577855</td>
</tr>
</table>
THE END

You might also like