定義說明基于列的表格缺省屬性。 Specifies column-based defaults for the table properties. 注釋COL 元素可嵌套于 COLGROUP 元素內(nèi)。如果是這樣的話,嵌套的 COL 屬性將覆蓋 COLGROUP 屬性。 你可使用元素 COL 和 COLGROUP 用于類似的目的。但是,你必須使用 COLGROUP 元素來決定表格內(nèi)部分隔線(rules)應(yīng)該處于的位置。見下面的的示例。 使用 SPAN 屬性可以指定 COLGROUP 定義的表格列數(shù)。該屬性的缺省值為 1。 TABLE 對象及其關(guān)聯(lián)元素有一個獨立的表格對象模型,該模式使用不同于常規(guī)對象模型的方法。要獲得關(guān)于表格對象模型更多的信息,請參看如何動態(tài)生成表格。 此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的腳本中可用。 此元素是塊元素。 此元素不需要關(guān)閉標(biāo)簽。 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 example below. 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 How to Build Tables Dynamically. 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 does not require a closing tag. 示例代碼下面的例子使用了 COL 元素說明表格中缺省列的特征。 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> 另見 |
|