# HTML DOM TableRow Object

« Previous
Next Reference »

## TableRow Object

The TableRow object represents an HTML <tr> element.

### Access a TableRow Object

You can access a <tr> element by using getElementById():

var x = document.getElementById("myTr"); Try it

Tip: You can also access a <tr> element by searching through the rows collection of a table.

### Create a TableRow Object

You can create a <tr> element by using the document.createElement() method:

var x = document.createElement("TR"); Try it

## TableRow Object Collections

Collection | Description
--- | ---
cells | Returns a collection of all <td> or <th> elements in a table row

## TableRow Object Properties

Property | Description
--- | ---
align | Not supported in HTML5. Use style.textAlign instead. Sets or returns the horizontal alignment of the content within a table row
bgColor | Not supported in HTML5. Use style.backgroundColor instead. Sets or returns the background color of a table row
ch | Not supported in HTML5. Sets or returns an alignment character for cells in a table row
chOff | Not supported in HTML5. Sets or returns the horizontal offset of the ch property
height | Not supported in HTML5. Use style.height instead. Sets or returns the height of a table row.
rowIndex | Returns the position of a row in the rows collection of a table
sectionRowIndex | Returns the position of a row in the rows collection of a tbody, thead, or tfoot
vAlign | Not supported in HTML5. Use style.verticalAlign instead. Sets or returns the vertical alignment of the content within a table row

## TableRow Object Methods

Method | Description
--- | ---
deleteCell() | Deletes a cell from the current table row
insertCell() | Inserts a cell into the current table row

## Standard Properties and Events

The TableRow object also supports the standard properties and events.

## Related Pages

HTML tutorial: HTML Tables

HTML reference: HTML <tr> tag

« Previous
Next Reference »

### WEB HOSTING

UK Reseller Hosting

### WEB BUILDING

FREE Website BUILDER Free HTML5 Templates

### W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

### SHARE THIS PAGE

### Color Picker

### HTML/CSS

HTML Tutorial HTML5 Tutorial CSS Tutorial CSS3 Tutorial Bootstrap Tutorial

### JavaScript

JavaScript Tutorial jQuery Tutorial jQuery Mobile Tutorial AngularJS Tutorial AJAX Tutorial JSON Tutorial

### Graphics

Canvas Tutorial SVG Tutorial Google Maps Tutorial

### Server Side

SQL Tutorial PHP Tutorial ASP Tutorial ASP.NET Tutorial VBScript Tutorial AppML Tutorial

### Web

Web Building Web Statistics Web Certification

### XML

XML Tutorial DTD Tutorial Schema Tutorial XML DOM Tutorial XPath Tutorial XSLT Tutorial XQuery Tutorial XSL-FO Tutorial RSS Tutorial WSDL Tutorial

### HTML/CSS

HTML Tag Reference HTML Event Reference HTML Color Reference CSS 1,2,3 Reference Bootstrap Reference

### JavaScript

JavaScript Reference HTML DOM Reference jQuery Reference jQuery Mobile Reference Google Maps Reference

### Server Side

PHP Reference SQL Reference ASP Reference VBScript Reference Razor Reference ASP.NET Reference

### XML

XML DOM Reference XSLT Reference XSL-FO Reference XPath Reference XQuery Reference Schema Reference RSS Reference SVG Reference

### HTML Charsets

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML Symbols HTML UTF-8

### HTML/CSS

HTML Examples CSS Examples

### Browser Scripting

JavaScript Examples HTML DOM Examples jQuery Examples jQuery Mobile Examples AngularJS Examples AJAX Examples

### Server Scripting

PHP Examples ASP Examples VBScript Examples Razor Examples .NET Examples

### XML Languages

XML Examples DTD Examples XML DOM Examples XSL Examples XSLT Examples XPath Examples XQuery Examples Schema Examples RSS Examples SVG Examples