1. To add space between cell text and borders, what keyword do you use?
That's correct. Well done!
The correct answer:
padding
Press Tab or click button to advance to next exercise.
2. To add spacing between cells, what keyword do you use?
That's correct. Well done!
The correct code:
border-spacing
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
3. Code the first line that adds space between text and border in data cells.
That's correct. Well done!
The correct code:
td {
Press Tab or click button to advance to next exercise.
4. Write the first line of code that adds space between data cells.
That's correct. Well done!
The correct code:
table {
Press Tab or click button to advance to next exercise.
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to add space between text and borders.<
6. Click in the box and type the next character. I'll autocomplete. Don't type spaces or carriage returns. When the exercise is complete, I'll turn the exercise number green.
Add a quarter of an em space between text and borders for headings.
That's correct. Well done!
Press Tab or click button to advance to next exercise.
7. Fail-safe coding. If you type the wrong character, I'll cancel the keystroke. Type spaces. When the exercise is complete, I'll turn the exercise number green.
Code 3 lines of CSS that add 1 em of space between cells.
Press Tab or click button to advance to next exercise.
That's correct. Well done!
8. Explicitly specify the default padding for data cells. Code all three lines.
That's correct. Well done!
The correct code:
td {
padding: 0;
}
Press Tab or click button to advance to next exercise.
9. Specify padding for a class of data cells. Make up the amount of padding and the class name.
That's correct. Well done!
Example:
td.spacious {
padding: 1.5em;
}
Press Tab or click button to advance to next exercise.
10. Specify a minimal solid black border and a half em of padding for data cells.
That's correct. Well done!
The correct code:
td {
border: 1px solid black;
padding: .5em;
}
Press Tab or click button to advance to next exercise.
11. For headings, specify no padding for the top and bottom and 1 em of padding right and left.
That's correct. Well done!
The correct code:
th {
padding: 0 1em 0 1em;
}
Press Tab or click button to advance to next exercise.
12. Add 2 ems of space between cells. Code all three lines.
That's correct. Well done!
The correct code:
table {
border-spacing: 2em;
}
Press Tab or click button to advance to next exercise.
The next several exercises are timed. If you type slowly or dislike time pressure, feel free to increase the allotted time.
13. Time goal: 35 seconds. Add 1 em of space between cells. Code all three lines.
Press Tab or click button to check answer.
The correct code:
table {
border-spacing: 1em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
14. Time goal: 25 seconds. Explicitly specify the default padding for data cells. Code all three lines.
Press Tab or click button to check answer.
The correct code:
td {
padding: 0;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
15. Time goal: 35 seconds. Specify padding for a class of data cells. Make up the amount of padding and the class name.
Press Tab or click button to check answer.
Example:
td.spacious {
padding: 1.5em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
16. Time goal: 50 seconds. Specify a minimal solid black border and a half em of padding for data cells.
Press Tab or click button to check answer.
The correct code:
td {
border: 1px solid black;
padding: .5em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
17. Time goal: 30 seconds. For headings, specify no padding for the top and bottom and 1 em of padding right and left.
Press Tab or click button to check answer.
The correct code:
th {
padding: 0 1em 0 1em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
18. Time goal: 35 seconds. Add 2 ems of space between cells. Code all three lines.
Press Tab or click button to check answer.
The correct code:
table {
border-spacing: 2em;
}
Press Tab or click button to advance to next exercise.
Press Tab or click button to advance to next exercise.
19. Access this live coding exercise at JS Fiddle. When you've completed the exercise, close the JS Fiddle window, and you'll be returned to this page. (If JS Fiddle displays a warning message saying that your changes will be reset, click Leave this Page.)
Click button to advance.
20. Access this live coding exercise at JS Fiddle. When you've completed the exercise, close the JS Fiddle window, and you'll be returned to this page. (If JS Fiddle displays a warning message saying that your changes will be reset, click Leave this Page.)
Click button to advance.
Post a review on Amazon for the paperback or the Kindle edition.
Email me to give me a compliment, complaint, or correction. I'll respond.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
1
0