Tables Flashcards

1
Q

How do you add a table?

A
<table><br>
<tr><br>
<td><td/><br>
<td><td/><br>
<td><td/><br>
</tr><br>
<tr><br>
<td><td/><br>
<td><td/><br>
<td><td/><br>
</tr><br>
</table><br>

This would make a table with two rows and three columns.

You create a table by adding rows <tr> and then an individual table data tag <td> for each cell in the table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When would we add a table

A

Displaying sports results
Tabular information
Financial Information
Display information in a grid format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do we add a table header tag

A

<th>

This can take a scope attribute to indicate if its a header for a row or column
</th>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Do I need to add a td tag if that cell would not have any content?

A

Yes, otherwise the table won’t render correctly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can we make a data spread across multiple rows or columns?

A

Use the rowspan and colspan attributes.

These take a number as the value.

When using these attributes you don’t need to include an empty td tag for the row/column that’s being spanned over.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What extra elements can we use if we have a long table

A

<thead>
<tbody>
<tfooter>
</tfooter></tbody></thead>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly