RULES Attribute | rules Property 表格的rules标签详解

Sets or retrieves which dividing lines (inner borders) are displayed.

Syntax

HTML
<TABLE RULES = sRule... >

Scripting
TABLE.rules [ = sRule ]

Possible Values

sRule
String that specifies or receives one of the following values.

all
Borders are displayed on all rows and columns.

cols
Borders are displayed between all table columns.

groups
Horizontal borders are displayed between all tHead, tBody, and tFoot objects; vertical borders are displayed between all colGroup objects.

none
All interior table borders are removed.

rows
Horizontal borders are displayed between all table rows.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

The value none turns off only the interior borders. To turn off the table borders, set the rules property to '', or omit the RULES attribute from the table object.

Examples

This example initially sets the RULES attribute on the table, and then uses the rules property to dynamically change the table borders.

HideExample

<TABLE ID="oID_1" RULES="cols">
<THEAD>
<TR>
<TD>EST</TD><TD>1am</TD><TD>8pm</TD>
</TR>
</THEAD>
<TR>
<TD>CST</TD><TD>2am</TD><TD>9pm</TD>
</TR>
<TR>
<TD>MST</TD><TD>3am</TD><TD>10pm</TD>
</TR>
<TFOOT>
<TR>
<TD>PST</TD><TD>4am</TD><TD>11pm</TD>
</TR>
</TFOOT>
</TABLE>
<P>
<BUTTON οnclick="oID_1.rules=''">No borders</BUTTON>
<BUTTON οnclick="oID_1.rules='none'">Exterior border</BUTTON>
<BUTTON οnclick="oID_1.rules='all'">All borders</BUTTON><BR>
<BUTTON οnclick="oID_1.rules='cols'">Column borders</BUTTON>
<BUTTON οnclick="oID_1.rules='groups'">Groups borders</BUTTON>
<BUTTON οnclick="oID_1.rules='rows'">Table row borders</BUTTON>
</P>

转载于:https://www.cnblogs.com/xuliping/archive/2010/12/02/1894766.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值