HTML Tables Flashcards
Table Element
<table></table>
Used to create the table before displaying the data
Table Rows Element
<tr></tr>
Creates the rows in a table
Table Data Element
<td></td>
Used to add data in a table
Table Headings Element
<th></th>
Like the table Data element but for showing the reader what data the column or row the corresponding cells will contain.
A blank heading is needed to correctly align the heading and the rows and columns.
To assign a heading as either a row or column you need to use the scope attribute which will look like the following:
<th>Data</th>
<th>Data</th>
Colspan Attribute
<td>Data</td>
Data can span columns using the colspan attribute.
<td>Data</td>
The number in the quotes is to denote the number of columns the data spans across.
Rowspan Attribute
<td>Data</td>
Data can span rows using the rowspan attribute.
<td>Data</td>
The number in the quotes is to denote the number of rows the data spans across.
Table Head Element
<thead></thead>
When a table’s body is sectioned off it also makes sense to section off the table’s column headings using the table head element
Table Body Element
<tbody></tbody>
The table body element should contain all of the table’s data, excluding the table headings
Table Footer Element
<tfoot></tfoot>
Footers are often used to contain sums, differences, and other data results.