Table objects in Javascript

Source: Internet
Author: User

Table object set

Table object: The table in the HTML document. For each <Table> mark in the document, the browser creates a table object.

Set Description
Cells [] Returns an array containing all cells in the table.
Rows [] Returns an array containing all rows in a table.
Tbodies [] Returns an array containing all tbodies in the table.
Table Object Attributes
Border Set or retrieve table borders
Caption Set or retrieve table titles
Cellpadding Set or retrieve the border and content width of each cell
Cellspacing Set or get the cell spacing in the table
Frame Set or obtain the border of a table
Rules Set or retrieve the internal border in the table
Summary Set or retrieve table descriptions
Tfoot Get the table's tfoot object
Thead Get thead object of the table
Width Set or retrieve table width
Accesskey Set or obtain the shortcut key for this object
Align Sets or obtains the horizontal alignment of text in cells in a table row.
Choff Set or obtain the cell alignment and offset features
Colspan Sets or obtains the number of table columns that a cell spans.
Height Set or retrieve the table Row Height
Innerhtml Set or obtain HTML text between table row tags
Innertext Set or obtain text between table row tags
Rowindex Obtain the position of the table row object in the table row set.
Sectionrowindex Get the location of the table row object in the tbody, thead, or tfoot in the row set
Tabindex Set or obtain the tab sequence index of table rows
Valign Sets or obtains the vertical alignment of text in a table row.
Table object Method
Createcaption () Create an empty title element for the table
Createtfoot () Create an empty tfoot element for the table
Createthead () Create an empty thead element for the table
Deletecaption () Delete table title Element
Deleterow () Deletes a specified table row.
Deletetfoot () Delete the tfoot element of a table
Deletethead () Delete the thead element of a table
Blur () Cancel the activation status of this object
Click () Simulate Mouse clicking on this object
Deletecell ([I]) Deletes a specified cell in a table row.
Focus () Move focus to table row
Insertcell () Insert a new cell into the table row
Insertrow () Insert a new row into the table
   

Tablecell Object Attributes

Tablecell object: The table cell in the HTML document. For each <TD> tag in the document, the browser creates a tablecell object.

Attribute Description
Abbr Set or retrieve the cell Summary
Align Sets or obtains the horizontal alignment of text in a cell.
Axis Sets or retrieves a list of related cells separated by commas (,).
Cellindex Obtains the position of a cell in the row cell set.
Ch Set or obtain cell alignment features
Choff Set or obtain the cell alignment and offset features
Colspan Sets or obtains the number of table columns that a cell spans.
Headers Sets or obtains the ID list of cells separated by spaces.
Height Set or retrieve the cell height
Innerhtml Set or obtain HTML text between cell tags
Nowrap Sets or obtains whether the cell line breaks automatically.
Rowspan Sets or obtains the number of rows in a table that a cell spans.
Scope Set or obtain the data column associated with the title
Valign Sets or obtains the vertical alignment of cell text.
Width Set or retrieve the cell width

 

Reprinted from: http://www.aspok.net/Html/Article/JavaScript/145.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.