Table of Contents

Class HTMLTableCellElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLTableCellElement interface provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header cells ({{HTMLElement("th")}}) or data cells ({{HTMLElement("td")}}), in an HTML document.

[Value("HTMLTableCellElement")]
public class HTMLTableCellElement : HTMLElement
Inheritance
HTMLTableCellElement
Inherited Members

Remarks

-The HTML elements implementing this interface: th and td.

See also on MDN

Constructors

HTMLTableCellElement()

public HTMLTableCellElement()

Properties

Abbr

The abbr property of the HTMLTableCellElement interface
indicates an abbreviation associated with the cell. If the cell does not represent a header cell th, it is ignored.

[Value("abbr")]
public string Abbr { get; set; }

Property Value

string

A string.

Remarks

It reflects the abbr attribute of the th element.

NOTE

This property doesn't have a visual effect in browsers. It adds information to help assistive technology like screen readers that can use this abbreviation

See also on MDN

Align

IMPORTANT
Deprecated
The align property of the HTMLTableCellElement interface is a string indicating how to horizontally align text in the {{htmlelement("th")}} or {{htmlelement("td")}} table cell.
[Value("align")]
public string Align { get; set; }

Property Value

string

The possible values are:

Remarks

NOTE

This property is deprecated, and CSS should be used to align text horizontally in a cell. Use the CSS text-align property, which takes precedence, to horizontally align text in a cell instead.

-text-align
-Learn: Styling tables

See also on MDN

Axis

[Value("axis")]
public string Axis { get; set; }

Property Value

string

BgColor

IMPORTANT
Deprecated
The HTMLTableCellElement.bgColor property is used to set the background color of a cell or get the value of the obsolete bgColor attribute, if present.
[Value("bgColor")]
public string BgColor { get; set; }

Property Value

string

One of the following value types can be used:

NOTE
The values accepted here are a limited subset of the CSS color values. Only named-color and 3- or 6-digit hex-color (with no alpha-channel). While all HTML color values are valid in CSS, this is not true in the other direction.

Remarks

NOTE

This property is deprecated and CSS should be used to set the background color. Use the background-color property instead.

-BgColor

See also on MDN

CellIndex

The cellIndex read-only property of the HTMLTableCellElement interface
represents the position of a cell within its row (tr). The first cell has an index of 0.

[Value("cellIndex")]
public long CellIndex { get; }

Property Value

long

Returns the index of the cell, or -1 if the cell is not part of any row.

Remarks

Ch

IMPORTANT
Deprecated
The ch property of the HTMLTableCellElement interface does nothing. It reflects the char attribute of the cell element.
[Value("ch")]
public string Ch { get; set; }

Property Value

string

A single character.

Remarks

NOTE

This property was designed to participate to the ability to align table cell content on a specific character (typically the decimal point), but was never implemented by browsers.

To achieve such alignment, watch for the support of a string value with the text-align CSS property.

-text-align

See also on MDN

ChOff

IMPORTANT
Deprecated
The chOff property of the HTMLTableCellElement interface does nothing. It reflects the charoff attribute of the cell element.
[Value("chOff")]
public string ChOff { get; set; }

Property Value

string

An integer.

Remarks

NOTE

This property was designed to participate in an ability to align table cell content on a specific character (typically the decimal point), but was never implemented by browsers.

To achieve such alignment, watch for the support of a string value with the text-align CSS property.

-text-align

See also on MDN

ColSpan

The colSpan property of the HTMLTableCellElement interface represents the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table. It reflects the colspan attribute.

[Value("colSpan")]
public ulong ColSpan { get; set; }

Property Value

ulong

A positive number representing the number of columns.

NOTE
When setting a new value, the value is clamped to the nearest strictly positive number.

Remarks

Headers

The headers property of the HTMLTableCellElement interface
contains a list of IDs of th elements that are headers for this specific cell.

[Value("headers")]
public string Headers { get; set; }

Property Value

string

A string containing space-separated IDs.

Remarks

Height

[Value("height")]
public string Height { get; set; }

Property Value

string

NoWrap

IMPORTANT
Deprecated
The noWrap property of the HTMLTableCellElement interface returns a Boolean value indicating if the text of the cell may be wrapped on several lines or not.
[Value("noWrap")]
public bool NoWrap { get; set; }

Property Value

bool

A Boolean value.

Remarks

NOTE

This property is deprecated and you should use the CSS white-space property with the value nowrap instead.

See also on MDN

RowSpan

The rowSpan property of the HTMLTableCellElement interface represents the number of rows this cell must span; this lets the cell occupy space across multiple rows of the table. It reflects the rowspan attribute.

[Value("rowSpan")]
public ulong RowSpan { get; set; }

Property Value

ulong

A positive number representing the number of rows. If it is 0, it means all remaining rows in the column.

NOTE
When setting a new value, a value different from 0 is clamped to the nearest strictly positive number.

Remarks

Scope

The scope property of the HTMLTableCellElement interface
indicates the scope of a th cell.

[Value("scope")]
public string Scope { get; set; }

Property Value

string

One of the following values:

Remarks

Header cells can be configured, using the scope attribute, to apply to a specified row or column, or to the not-yet-scoped cells within the current row group (that is, the same ancestor thead, tbody, or tfoot element). If no value is specified for scope, the header is not associated directly with cells in this way. Permitted values for scope are:

NOTE

This property doesn't have a visual effect in browsers. It adds semantic information to help assistive technology like screen readers to present the table in a more coherent way.

See also on MDN

VAlign

IMPORTANT
Deprecated
The vAlign property of the HTMLTableCellElement interface is a string indicating how to vertically align text in a {{htmlelement("th")}} or {{htmlelement("td")}} table cell.
[Value("vAlign")]
public string VAlign { get; set; }

Property Value

string

The possible values are: "top", "middle", "bottom", or "baseline"

Remarks

NOTE

This property is deprecated. Use the CSS vertical-align property to horizontally align text in a cell instead.

-vertical-align
-Learn: Styling tables

See also on MDN

Width

[Value("width")]
public string Width { get; set; }

Property Value

string