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

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML <tr>标签


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

定义与用法

Defines a row in a table.
定义表格的行


在HTML和XHTML中的区别

The "bgcolor" attribute of the tr element were deprecated in HTML 4.01.
在HTML4.01不推荐使用tr元素的"bgcolor"属性

The "bgcolor" attribute of the tr element are not supported in XHTML 1.0 Strict DTD.
XHTML4.01严密型DTD不支持tr元素的"bgcolor"属性


实例

代码 输出
<table border = "1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
Cell A Cell B


可选属性

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 text alignment in cells
定义单元文字的对齐方式
STF
bgcolor rgb(x,x,x)
#xxxxxx
colorname
Specifies the background color of the table cell. Deprecated. Use styles instead.
指定表格单元的背景颜色[不推荐]请使用样式
TF
char character Specifies which character to align text on.
指定向哪个字符看齐

Note: Only used if align="char"!
注意:只能当align="char"的时候才能使用

STF
charoff pixels
%
Specifies the alignment offset to the first character to align on.
取消向第一个字符对齐

Note: Only used if align="char"!
注意:只能当align="char"的时候才能使用

STF
valign top
middle
bottom
baseline
Specifies the vertical text alignment in cells
指定文字在单元内的垂直对齐
STF

标准属性

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.
查看完整的属性


尝试与演示

Tables
How to create tables in an HTML document.
在HTML中建立表格

Table borders
Different table borders.
定义表格的边框

Table with no borders
A table with no borders.
一个没有边框的表格

Headings in a table
How to display table headers.
显示表格的标题

Empty cells
How to use "&nbsp;" to handle cells that have no content.
如何使用"&nbsp"来处理没有内容的单元格

Table with a caption
A table with a caption.
带有标题的表格

Table cells that span more than one row/column
How to define table cells that span more than one row or one column.
如何定义一个带有多行或多列跨度的表格

Tags inside a table
How to display elements inside other elements.
如何在另外的元素的里面显示元素

Cell padding
How to use cellpadding to create more white space between the cell content and its borders.
如何使用使用cellpadding来增加单元格到文字间的距离

Cell spacing
How to use cellspacing to increase the distance between the cells.
如何使用cellpacing来增加单元格之间的距离

Add a background color or a background image to a table
How to add a background to a table.
如何给表格加上背景

Add a background color or a background image to a table cell
How to add a background to one or more table cells.
如何为表格单元格加上一个或多个背景

Align the content in a table cell
How to use the "align" attribute to align the content of cells.
如何使用"align"属性来对齐单元格里的文字

The frame attribute
How to use the "frame" attribute to control the borders around the table.
怎样使用"frame"属性来控制表格周围的边框

评论 (0) All

登陆 | 还没注册?