当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <colgroup>标签

HTML
HTML 介绍
HTML 元素
HTML 基本标签
HTML 格式
HTML 实体字符
HTML 链接
HTML 框架
HTML 表格
HTML 列表
HTML 表单
HTML 图片
HTML 背景
HTML 颜色
HTML 颜色值
HTML 颜色名
HTML 便条
HTML 布局
HTML 字体
HTML 4.0
HTML 样式

HTML <colgroup>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 415 ::
收藏到网摘: n/a

Definition and Usage
使用方法

Defines groups of table columns. With this element, you can group columns for formatting. This element is only valid inside the <table> tag.
定义表格列组。使用这个元素可以格式化列组。这个元素只在<table>标签中使用才有效。


Differences Between HTML and XHTML
它在HTML和XHTML中的区别

NONE


Tips and Notes
提示与注意点

Note: The colgroup element is an empty element that contains attributes only. To create columns, you must specify td elements within a tr element.
注意:colgroup元素为空元素,只包含属性。你必须在tr元素里指定td元素才能建立列。


实例

This example creates a table with four columns, with the first three columns in one colgroup, and the last column in the second colgroup:
该例将建立一个带有四个列的表格。前三个列将并在一个colgroup中,剩下的一个在第二个colgroup:

代码 输出结果
<table border="1">
<colgroup span="3" style="color:#FF0000;">
</colgroup>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</table>
1 2 3 4


可选属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)

属性名 描述 DTD
align right
left
center
justify
char
Defines the horizontal alignment of the content in the table cell, in the column
定义表格单元内或是列内文字的的水平对齐方向
STF
char character Defines a character to use to align text on (use with align="char")
向某字对齐(得同时用上align="char")
STF
charoff pixels
%
Defines an alignment offset to the first character to align on, as set with char
取消向某字对齐
STF
span number Defines the number of columns the <col> should span
定义所要跨度列的数量
STF
valign top
middle
bottom
baseline
Defines the vertical alignment of the content in the table cell, in the column
定义表格单元内或是列内文字的垂直对齐
STF
width %
pixels
relative_length
Defines the width of the column.
定义列的宽度

Note: Overrides the width set in <colgroup>
注意:优先级高于在<colgroup>里的设置

标准属性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的描述

事件属性

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
查看完整的描述

评论 (0) All

登陆 | 还没注册?