w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: DOM 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).
| 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 |
| 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 |
| 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 |
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