col

< html‎ | elements
Jump to: navigation, search

col

This article is In Progress.



Summary

The col element (<col>) specifies properties for each column within a <colgroup> element in a <table>.


Overview Table

DOM Interface HTMLTableColElement


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
1.0
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes
align/valign attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown
char/charoff attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown
bgcolor attribute
?
Unknown
?
none
?
Yes
?
Unknown
?
Unknown

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Unknown
1.0
Yes
?
Unknown
?
Unknown
?
Unknown
align/valign attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown
char/charoff attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown
bgcolor attribute
?
Unknown
?
none
?
Unknown
?
Unknown
?
Unknown

Examples

This example uses the col element to specify characteristics for default columns in a table.

<HTML>
<BODY>
<TABLE BORDER="2" RULES="groups">
<!-- RULES is set to "groups", which has no effect in this sample. For this 
attribute to work, you must use COLSPAN to define the groups of columns.-->
    <COL SPAN="2" STYLE="color:red">
    <COL STYLE="color:blue">
    <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>

Notes

Remarks

COL elements can be nested within a COLGROUP element. If this is done, the nested COL attributes override the COLGROUP attributes. You can use the COL and COLGROUP elements 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 following example. Use the SPAN attribute to specify the number of table columns that the COLGROUP defines. This attribute has a default value equal to one. 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, see Building Tables Dynamically.

HTML information

{


See also

Related articles

HTML



































  • col
















… further results

Tables






  • col









  • colGroup

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]