Download presentation
Presentation is loading. Please wait.
1
HTML Tables CS 1150 Fall 2016
2
What is a table? A table represents information in a grid format
Grids allow us to understand complex data by referencing information on two axes Each block in the grid is referred to as a table cell In HTML, a table is written out row by row
3
Basic Table Structure All tables are surrounded by <table> opening and </table> closing tags Each row is delimited by <tr> opening and </tr> closing tags Each cell of a table is delimited by <td> opening and </td> closing tags
4
Table Structure Example
<table> <tr> <td>15</td> <td>30</td> </tr> <td>45</td> <td>60</td> </table>
5
Naming Rows and Columns
Use the <th> element to name rows and columns Specify if you are naming a row or column by using the attribute scope Example: <th scope=“col”>Tickets Sold</th> Example file:
6
Spanning Rows and Columns
Add the colspan attribute to a <td> opening tag to make a cell span two or more columns Add the rowspan attribute to a <td> opening tag to make a cell span two or more rows Example: <td rowspan=“2”>Movie</td>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.