当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > DOM Table 对象

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM 中的 DOM Table 对象


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

Table 对象

The Table object represents an HTML table. For each instance of an HTML <table> tag in a document, a Table object is created.
Tbale对象代表了HTML表格。每当HTML文档中出现<table>标签,就有一个Table对象建立起来了

IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

Table 对象集合

Collection
集合
Description
描述
IE  F N W3C
cells[] Returns an array containing each cell in the table
返回包含表格单元格的数组
5     No
rows[] Returns an array containing each row in the table
返回包含表格每行的数组
4 1 6 Yes
tBodies[] Returns an array containing each tbody the table
返回每个表格tbody的数组
4     Yes

Table 对象属性

Property
属性
Description
描述
IE  F N W3C
accessKey Sets or returns the keyboard key to access the table
设置或返回表格的快速访问键
4     No
align Sets or returns the alignment of the table according to the surrounding text
设置或获取表格排列。
4 1 6 Yes
background Sets or returns the background image of the table
设置或获取对象中文本和图像后平铺的背景图片。
4     No
bgColor Sets or returns the background color of the table
不推荐。设置或获取对象后面的背景颜色。
4 1 6 Yes
border Sets or returns the width of the table border
设置或获取绘制对象周围边框的宽度。
4 1 6 Yes
borderColor Sets or returns the color of the table border
设置或获取对象的边框颜色。
5     No
caption Sets or returns the caption of the table
获取表格的 caption 对象。
4 1 6 Yes
cellPadding Sets or returns the amount of space between the cell border and cell content
设置或获取介于单元格边框和单元格内容之间的空间总量。
4 1 6 Yes
cellSpacing Sets or returns the amount of space between cells in the table
设置或获取表格中单元格之间的空间总量。
4 1 6 Yes
cols Sets or returns the number of columns in the table
设置或获取表格的列数。
4     No
disabled Sets or returns whether or not the table should be disabled
获取表明用户是否可与该对象交互的值。
5     No
frame Sets or returns which borders to render around the table
设置或获取表格周围的边框显示的方式。
4 1 6 Yes
height Sets or returns the height of the table
设置或获取对象的高度。
4 1 6 Yes
id Sets or returns the id of the table (In IE 4 this property is read-only)
获取标识对象的字符串。
4 1   No
rules Sets or returns which inner-borders to display in a table
设置或获取要显示哪些分隔线(内部边框)。
4 1 6 Yes
summary Sets or returns a description of the table
设置或获取对象的描述和/或结构。
6 1 6 Yes
tabIndex Sets or returns the tab order for the table
设置或获取定义对象的 Tab 顺序的索引。
4     No
tFoot Returns the TFoot object of the table
获取表格的 tFoot 对象。
4 1 6 Yes
tHead Returns the THead object of the table
获取表格的 tHead 对象。
4 1 6 Yes
width Sets or returns the width of the table
设置或获取对象的宽度。
4 1 6 Yes

Table 对象方法

Method
方法
Description
描述
IE F N W3C
blur() Removes focus from the table
对象失去输入焦点时触发。
4     No
click() Simulates a mouse-click on the table
在用户用鼠标左键单击对象时触发。
4     No
createCaption() Creates an empty caption element in the table
在表格中建立一个不带内容的标题元素
4 1 6 Yes
createTFoot() Creates an empty tFoot element in the table
在表格中建立一个不带内容的tFoot元素
4 1 6 Yes
createTHead() Creates an empty tHead element in the table
在表格中建立一个不带内容的tHead元素
4 1 6 Yes
deleteCaption() Deletes the caption element and its content from the table
从表格中删除元素标题以及它的内容
4 1 6 Yes
deleteRow() Deletes a specified row from the table
从表格中删除指定的行
4 1 6 Yes
deleteTFoot() Deletes the tFoot element and its content from the table
从表格中删除tFoot元素以及它的内容
4 1 6 Yes
deleteTHead() Deletes the tHead element and its content from the table
从表格删除tHead元素以及它的内容
4 1 6 Yes
focus() Sets focus on the table
表格获取焦点
4     No
insertRow() Inserts a new row in the table
在表格中插入新的行
4 1 6 Yes
moveRow(from,to) Moves a row to a new position
将一行移动到新的位置上
5     No
refresh() Refreshes the content of the table
刷新表格中的内容
4     No

Table 对象事件

Syntax: object.event_name="someJavaScriptCode"
语法:对象.事件名称="一些JS代码"

Event
事件
Description
描述
IE F N W3C
onBlur Executes some code when the table loses focus
当表格失去焦点的时候执行一些代码
4      
onClick Executes some code when the user clicks on the table
当用户点击表格的时候执行一些代码
4      
onFocus Executes some code when the table gets focus
当表格得到焦点的时候执行一些代码
4      
onSelectStart Executes some code when the table is selected
当表格被选中的时候执行一些代码
4      

评论 (0) All

登陆 | 还没注册?