DOM操作表格的各种属性[z]
生活随笔
收集整理的這篇文章主要介紹了
DOM操作表格的各种属性[z]
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
The TableData object represents an HTML table data element. For each instance of an HTML <td> tag in a document, a TableData object is created. TableDate對象代表了HTML表格的data元素。每當文檔中出現<yd>標簽,就有TableData對象被建立起來
IE:?Internet Explorer,?F:Firefox,N:Netscape,W3C:?World Wide Web Consortium (Internet Standard).
TableData 對象屬性
Property 屬性 Description 描述 IE? F N W3C| abbr | Sets or returns an abbreviated text for the table cell (for non-visual media such as speech or Braille) 設置或返回表格單元格的縮寫文字(針對那些非視覺化的媒介) | 6 | ? | ? | Yes |
| accessKey | Sets or returns the keyboard key to access the table cell 設置或返回表格單元的快速訪問鍵 | 4 | ? | ? | No |
| align | Sets or returns the horizontal alignment of data within the table cell 設置或返回在表格單元內數據的水平對齊方式 | 4 | ? | ? | Yes |
| axis | Sets or returns a comma-delimited list of related table cells (categories) | 6 | ? | ? | Yes |
| background | Sets or returns the background image for the table cell 為表格單元設置或返回它的背景圖片 | 4 | ? | ? | No |
| bgColor | Sets or returns the background color for the table cell 為表格單元設置或返回它的背景顏色 | 4 | ? | ? | Yes |
| borderColor | Sets or returns the border color of the table cell 設置或返回表格單元的邊框顏色 | 4 | ? | ? | No |
| cellIndex | Returns the position of the cell in the cells collection of a row 返回在行中單元集合中單元的位置 | 4 | ? | ? | Yes |
| ch | Sets or returns the alignment character for the table cell 設置或返回表格單元的對齊特征 | 6 | ? | ? | Yes |
| chOff | Sets or returns the offset of alignment character for the table cell 設置或獲取可用于實現對象的你自己的 chOff 功能的字符串。 | 6 | ? | ? | Yes |
| colSpan | Sets or returns the number of columns the table cell should span 設置或獲取對象應該跨越的表格列數。 | 4 | ? | ? | Yes |
| disabled | Sets or returns whether or not the table cell should be disabled 設置或獲取控件的狀態。 | 5 | ? | ? | No |
| headers | Sets or returns a list of space-separated header cell ids 設置或獲取為對象提供信息的標題單元格。 | 6 | ? | ? | Yes |
| height | Sets or returns the height of the table cell 獲取或折紙表格單元的工作區域高度 | 4 | ? | ? | No |
| id | Sets or returns the id of the table cell (In IE 4 this property is read-only) 設置或返回表格單元的id | 4 | ? | ? | No |
| innerHTML | Sets or returns the HTML between the start and end tags of the table cell 設置或返回在表格單元標簽之間的HTML內容 | 4 | ? | ? | No |
| innerText | Sets or returns the text between the start and end tags of the table cell 設置或返回在表格單元標簽之間的文字內容 | 4 | ? | ? | No |
| noWrap | Sets or returns a Boolean value indicating whether or not the browser automatically performs word wrap in the table cell 設置或獲取瀏覽器是否執行表格單元內的自動換行。[布爾值] | 4 | ? | ? | Yes |
| outerHTML | Sets or returns the table data object and its content in HTML 設置或獲取表格單元對象及其內容的 HTML 形式。 | 4 | ? | ? | No |
| outerText | Sets or returns the text of the table data object 設置或獲取表格單元對象的文本。 | 4 | ? | ? | No |
| rowSpan | Sets or returns the number of rows the table cell should span 設置或獲取單元格要跨越表格的多少行。 | 4 | ? | ? | Yes |
| scope | ? | 6 | ? | ? | Yes |
| tabIndex | Sets or returns the tab order for the table cell 設置或獲取定義對象的 Tab 順序的索引。 | 4 | ? | ? | No |
| vAlign | Sets or returns how cell content are vertically aligned 設置或獲取標題是表格的上面還是下面。 | 4 | ? | ? | Yes |
| width | Sets or returns the width of the table cell 設置或獲取表格單元的寬度 | 4 | ? | ? | Yes |
TableData 對象方法
Method 方法 Description 描述 IE F N W3C| blur() | Removes focus from the table cell 取消表格單元的焦點 | 4 | ? | ? | No |
| click() | Simulates a mouse-click on the table cell 模仿鼠標對表格單元的點擊 | 4 | ? | ? | No |
| focus() | Sets focus on the table cell 為表格單元設置焦點 | 4 | ? | ? | No |
TableData 對象事件
Syntax: object.event_name="someJavaScriptCode" 語法:對象.事件名稱=“一些JS代碼”
Event 事件 Description 描述 IE F N W3C| onBlur | Executes some code when the table cell loses focus 當表格單元失去焦點的時候執行一些代碼 | 4 | ? | ? | ? |
| onClick | Executes some code when the user clicks on the table cell 當用戶點擊表格單元的時候執行一些代碼 | 4 | ? | ? | ? |
| onFocus | Executes some code when the table cell gets focus 當表格單元得到檢點的時候執行一些代碼 | 4 | ? | ? | ? |
| onSelectStart | Executes some code when the table cell is selected 當表格單元被選中的時候執行一些代碼 | 4 | ? | ? | ? |
?
js 代碼總結
以上是生活随笔為你收集整理的DOM操作表格的各种属性[z]的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用DOM操作样式表
- 下一篇: JavaScript 动态加载脚本和样式