All Tech Tips |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
COLGROUP Element | colGroup ObjectSpecifies property defaults for a column or group of columns in a table. Members Table
Remarks Nested COL elements override COLGROUP elements. Use the SPAN attribute to specify the number of table columns that the COLGROUP defines. This attribute has a default value equal to one. COL elements can occur outside of a COLGROUP element, and these two elements can be used for similar purposes. However, you must use the COLGROUP element to determine where table internal dividing lines (rules) should go. This is illustrated in the first example below. You should avoid using the SPAN attribute inside the COLGROUP element if there are COL elements nested within it. This is because the SPAN attribute that belongs to the nested COL elements will override the attribute that belongs to the COLGROUP element. This can cause confusing code and possibly unintended results. This behavior is illustrated in the second example below. The table object and its associated elements have a separate table object model, which uses different methods than the general object model. For more information on the table object model. This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0. This element is a block element. This element requires a closing tag. Examples This example uses the COLGROUP element to assign specific characteristics to two groups of columns in a table.
<HTML>
<BODY>
<TABLE BORDER="2" RULES="groups">
<!-- RULES is set to "groups", which places internal dividing lines around
table columns defined by COLGROUP. -->
<COLGROUP SPAN="2" STYLE="color:red">
</COLGROUP>
<COLGROUP STYLE="color:blue">
</COLGROUP>
<TR>
<TD>This column is in the first group.</TD>
<TD>This column is in the first group.</TD>
<TD>This column is in the second group.</TD>
</TR>
<TR>
<TD>This column is in the first group.</TD>
<TD>This column is in the first group.</TD>
<TD>This column is in the second group.</TD>
</TR>
</TABLE>
</BODY>
</HTML>
When COL elements are nested inside a COLGROUP element, the attributes of the COL elements override the attributes of the COLGROUP element. This is demonstrated in the following example.
<HTML>
<BODY>
<TABLE BORDER="2">
<COLGROUP SPAN="3" STYLE="color:green;background:black">
<!-- Styling is applied to only the first two columns, instead of all
three, and the font color is red instead of green. This is consistant
with the attributes of the COL element. -->
<COL SPAN="2" STYLE="color:red">
</COLGROUP>
<TR>
<TD>This column is in the first group.</TD>
<TD>This column is in the first group.</TD>
<TD>This column is in the second group.</TD>
</TR>
<TR>
<TD>This column is in the first group.</TD>
<TD>This column is in the first group.</TD>
<TD>This column is in the second group.</TD>
</TR>
</TABLE>
</BODY>
</HTML>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Copyright © 2006 alltechtips.com. All rights reserved.
This website and the materials and information you find on this website are provided "as is", without warranty of any kind, either express or implied, including without limitation any warranty for information, services, or products provided through or in connection with the service and any implied warranties of merchantability, fitness for a particular purpose, expectation of privacy or non-infringement.
Advertising
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||