Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

Practice exercises CHAPTER 5 243


■■Use the <caption> element directly after the <table> element to specify a caption for
your table.
■■Use the <colgroup> and <col> elements to apply styles to a column.

Lesson review


Answer the following questions to test your knowledge of the information in this lesson. You
can find the answers to these questions and explanations of why each answer choice is correct
or incorrect in the “Answers” section at the end of this chapter.


  1. You are creating a webpage that will be used to display a list of salespeople with their
    sales statistics for the years of 2010, 2011, and 2012 in two categories: sales of products
    and sales of services. You want to each of the years to be in the horizontal header, and
    under each year, you will have a “Products” column and a “Services” column. How will
    you define the element for year 2011?
    A. 2 0 1 1
    B. 2 011
    C. <th span=”2 ”>2 0 1 1
    D. <th st yle=”2 ”>2 0 1 1

  2. You want to provide the ability to display or show columns, but you don’t want to add
    a style or other marking to each element. How can you accomplish this?
    A. Add a element to the element and define each column by
    using a element inside the element.
    B. Add an id to each element to the
    element and provide a unique id for each; use the ids in
    your style sheet rules to obtain the desired style.
    C. Add a
    element and define each column by using a element inside the element.
    D. Add a element to the
    element and define each column by using
    a element inside the element.

  3. Which element can you add to the
  4. element to provide a table caption?
    A.
    B.
    C.

    D.


    Practice exercises


    If you encounter a problem completing any of these exercises, the completed projects can be
    installed from the Practice Exercises folder that is provided with the companion content.