Prelims - CSS tables Flashcards

1
Q

property sets whether the table borders should be collapsed into a single border:

A

border-collapse

table {
  border-collapse: collapse;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

property sets the horizontal alignment (like left, right, or center) of the content in <th> or <td>

A

text-align

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

To center-align the content of <td> elements as well, use

A

text-align: center

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

To left-align the content, force the alignment of <th> elements to be left-aligned, with the

A

text-align: left

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

property sets the vertical alignment (like top, bottom, or middle) of the content in <th> or <td>

A

vertical-align

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

To control the space between the border and the content in a table, use the

A

padding

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

Use the____ selector on <tr> to highlight table rows on mouse hover:

A

:hover

tr:hover {background-color: coral;}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

For zebra-striped tables, use the ____ selector and add a background-color to all even (or odd) table rows

A

nth-child()

tr:nth-child(even) {background-color: #f2f2f2;}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly