Business web site - 646 Part III . Document Objects Reference COL
Sunday, October 21st, 2007646 Part III . Document Objects Reference COL and COLGROUP Element Objects For HTML element properties, methods, and event handlers, see Chapter 15. Properties Methods Event Handlers align ch chOff span vAlign width See TABLE element object. See TBODY element object. Syntax Accessing COL and COLGROUP element object properties and methods: (IE4+) [window.]document.all.elemID.property | method([parameters]) (IE5+/NN6) [window.]document.getElementById( elemID ).property | method([parameters]) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . About these objects The purpose of the COL and COLGROUP elements is to allow cells within one or more columns to be treated as a single entity for purposes of style sheet and other style-related control. In other words, if you want one column of a table to be all boldface, you can assign that style sheet rule to the COL element that encompasses that column. All cells within that column inherit the style sheet rule definition. Having two different element names allows for the nesting of column groups, which can come in handy for complex tables. For instance, consider a table that reports the forecasted and actual sales for a list of products across four quarters of a year. The left column of the table stands alone with the product item numbers. To the right is one large grouping of eight columns that encompasses the four pairs of forecasted/ actual sales pairs. All eight columns of cells are to be formatted with a particular font style to help differentiate the pairs of columns for each quarter. You also want to assign a different background color. Therefore, you designate each pair of columns as its own subgroup within the eight-column master grouping. The COLGROUP and COL tags for this nine-column table are as follows: COL
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.