Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

Welcome to All Test Answers

Chapter 10 Data Tables

Download  file with answers

Not a member!

Create a FREE account here to get access and download this file with answers


 

Chapter 10: Data Tables

TRUE/FALSE

1. HTML tables are designed not only to present data properly in the browser window, but to be read sequentially by screen readers and other assistive devices.

 

2. Table

tags contain both table cells and content of their own.

 

3. If you use plenty of white space in your code, you will find your tables easier to access and change.

 

4. When you build column spans, it is important to make sure that all of your columns add up to the correct number of cells.

 

5. Adding a row span usually means adding an extra cell to accommodate the span.

 

6. Column groups are always applied right to left in the table.

 

7. In addition to position, you can also choose form any of the other style properties to enhance the caption text in a table.

 

8. You cannot add borders to tables using CSS style rules.

 

9. Borders can be applied to the whole table, to individual rows, and to individual cells.

 

10. Unlike other block-level elements, tables cannot be floated.

 

MULTIPLE CHOICE

1. The 3.2 release of HTML in ____ included table elements for the purpose of organizing tabular data in rows and columns.
a. 1985 c. 1995
b. 1989 d. 1997

 

2. The ____ element establishes the table.

 
3. The ____ element contains the table cells.
a.

c.b.

d.

ANS: C PTS: 1 REF: 448

4. The ____ element contains the table data.
a.

c.b.

d.

ANS: B PTS: 1 REF: 448

5. The ____ element contains header information for a column of data.
a.

c.b.

d.

ANS: D PTS: 1 REF: 448

6. The ____ tag marks the beginning and end of each row of a table.
a.

c.b.b. d.

ANS: C PTS: 1 REF: 455

14. The ____ element has a span attribute that lets you set the number of columns specified in the group.
a.

c. b. d.

 

15. The ____ element lets you specify style characteristics for individual columns.
a. c.

b. d.

 

16. Both

and elements must appear immediately after the opening ____ element, or after theelement if the table contains a caption.
a.

d.

 

7. The ____ element lets you add a caption to the table.
a. c.
b.

d. 

8. The element must appear immediately after the opening ____ tag.

a. table c. tr
b. td d. th 

9. The ____ element lets you create a table header cell that presents the cell content as bold and centered by default.
a. c. b.

d.

 

10. The ____ attribute lets you create cells that span multiple columns of a table.
a. colspan c. cspan
b. columnspan d. columnspans

 

11. The ____ attribute lets you create cells that span multiple rows of a table.
a. rowspan c. rspan
b. rospan d. rowspans

 

12. Often you will see the rowspan value set to “____” to ensure that the rowspan will always be greater than the number of rows in the table.
a. 0 c. 10
b. 1 d. 99

 

13. The

and ____ elements allow you to apply style characteristics to groups of columns or individual columns.

 

 

17. You can use the ____ element to apply class names and style individual columns.

4. Explain how you can style table borders.

ANS:
By default, tables are displayed in the browser with borders turned off. You can add borders to tables using CSS style rules. Borders can be applied to the whole table, to individual rows, and to individual cells. Using the table element as a selector applies the border only to the outside of the table.

The style rule for this table looks like the following code. Note that the border-collapse property is used to remove the extra space between the borders.

table {
border: solid 1px black;
border-collapse: collapse;
}

Borders do not inherit styles, so you can add borders for each cell by specifying them in a separate style rule. The sample table has two types of cells: table header cells

and table data cells

. These must each be added as selectors to make sure every cell has a border. The style rule looks like the following code. Notice that the

and

elements share the same style declaration.

table {
border: solid 1px black;
border-collapse: collapse;
}

th, td {
border: solid 1px black;
}

You can also style individual row and cell borders using classes or ids to make specific selections in the table. For example, a row selector could look like the following:

tr.header {background-color: #ccddee;}

PTS: 1 REF: 458-460

5. Explain how you can use padding in tables.

ANS:
You can enhance the legibility of your table data by adding padding values for the entire table, or alternately adding padding values in individual rows or cells with class selectors. The

element does not accept the padding property, so you have to apply it to theand

elements. This style rule adds 5 pixels of padding to both types of table elements:

th, td {padding: 5px;}

The following table uses this style rule to apply 5 pixels of padding to every cell.

table {
border: solid 1px black;
border-collapse: collapse;
}

th, td {
border: solid 1px black;
padding: 5px;
}

You can also specify individual padding properties for each cell or row. For example, you might specify that

cells have extra padding on the bottom:

th {padding-bottom: 10px;}

PTS: 1 REF: 461-463

About

Leave a reply

Captcha Click on image to update the captcha .

error: Content is protected !!