tables Flashcards
how do you make a table in HTML
<table></table>
explain table rows
<table>
<tr>
</tr>
<tr>
</tr>
</table>
table data <td> explain
Rows aren’t sufficient to add data to a table. Each cell element must also be defined. In HTML, you can add data using the table data element: <td>.
<table>
<tr>
<td>73</td>
<td>81</td>
</tr>
</table>
In the example above, two data points (73 and 81) were entered in the one row that exists. By adding two data points, we created two cells of data.
what are table headings <th></th>
<table>
<tr>
<th></th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
<tr>
<th>Temperature</th>
<td>73</td>
<td>81</td>
</tr>
</table>
table heading <th></th>
th scope=”col”>Saturday</th>
<th scope="col">Sunday</th>
</tr>
<tr>
<th>Temperature</th>
</tr>
explain how to create a border using html and css
We use CSS to add style to HTML documents, because it helps us to separate the structure of a page from how it looks. You can learn more about CSS in our CSS courses.
You can achieve the same table border effect using CSS.
table, td {
border: 1px solid black;
}
explain colspan to Spanning Columns
Data can span columns using the colspan attribute. The attribute accepts an integer (greater than or equal to 1) to denote the number of columns it spans across.
<table>
<tr>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
</tr>
<tr>
<td>Out of Town</td>
<td>Back in Town</td>
</tr>
</table>
In the example above, the data Out of Town spans the Monday and Tuesday table headings using the value 2 (two columns). The data Back in Town appears only under the Wednesday heading.