PTS 1 REF 451 453 2 Explain how you can group and style columns in a table ANS

Pts 1 ref 451 453 2 explain how you can group and

This preview shows page 6 - 9 out of 9 pages.

PTS:1REF:451-4532.Explain how you can group and style columns in a table.ANS:
The <colgroup> and <col> elements allow you to apply style characteristics to groups of columns or individual columns. The <colgroup> element has a span attribute that lets you set the number of col-umns specified in the group. Column groups are always applied left to right in the table. The only otheravailable property is width, which lets you specify the width of a column or group of columns.The <col> element lets you specify style characteristics for individual columns. It always appears within a set of <colgroup> tags. Both <colgroup> and <col> elements must appear immediately after the opening <table> element, or after the <caption> element if the table contains a caption.The code for the table follows. Notice that each column group contains a class name, which is used to apply a CSS background color to the column group. The <colgroup> elements appear directly after thecaption element.<table> <caption>Best Selling Albums Worldwide</caption><colgroup span="2" class="left"></colgroup> <colgroup span="3" class="right"></colgroup> <tr><th>Artist</th> <th>Album</th> <th>Released</th> <th>Genre</th> <th>Sales (millions)</th></tr>...rest of table code...You can use the <col> element to apply class names and style individual columns. The following HTML code in the table shows each column with a class name.<colgroup> <col class="artist" /> <col class="album" /> <col class="released" /> <col class="genre" /> <col class="sales" /></colgroup>These class names can be used as selectors in the style sheet. The following style rule selects the col-umn with the class name artist and applies a background color to the column..col.artist {background-color: #ddeeff;}PTS:1REF:455-4573.Explain how you can style the caption of a table.
4.Explain how you can style table borders.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture