HTMLTableCellElement
Represents the object for HTML table cell (td / th) elements.
namespace AngleSharp.DOM.Html
{
[DOM("HTMLTableCellElement")]
public sealed class HTMLTableCellElement : HTMLElement, IScopeElement, IImplClosed
{
[DOM("cellIndex")]
public int CellIndex {
get {
Element parentElement = base.ParentElement;
while (parentElement != null && !(parentElement is HTMLTableRowElement)) {
parentElement = parentElement.ParentElement;
}
if (parentElement is HTMLTableRowElement)
return ((HTMLTableRowElement)parentElement).Cells.IndexOf(this);
return 0;
}
}
[DOM("align")]
public HorizontalAlignment Align {
get {
return Element.ToEnum(GetAttribute("align"), HorizontalAlignment.Left);
}
set {
SetAttribute("align", value.ToString());
}
}
[DOM("vAlign")]
public VerticalAlignment VAlign {
get {
return Element.ToEnum(GetAttribute("valign"), VerticalAlignment.Middle);
}
set {
SetAttribute("valign", value.ToString());
}
}
[DOM("bgColor")]
public string BgColor {
get {
return GetAttribute("bgcolor");
}
set {
SetAttribute("bgcolor", value);
}
}
[DOM("width")]
public string Width {
get {
return GetAttribute("width");
}
set {
SetAttribute("width", value);
}
}
[DOM("height")]
public string Height {
get {
return GetAttribute("height");
}
set {
SetAttribute("height", value);
}
}
[DOM("colSpan")]
public uint ColSpan {
get {
return Element.ToInteger(GetAttribute("colspan"), 0);
}
set {
SetAttribute("colspan", value.ToString());
}
}
[DOM("rowSpan")]
public uint RowSpan {
get {
return Element.ToInteger(GetAttribute("rowspan"), 0);
}
set {
SetAttribute("rowspan", value.ToString());
}
}
[DOM("noWrap")]
public bool NoWrap {
get {
return Element.ToBoolean(GetAttribute("nowrap"), false);
}
set {
SetAttribute("nowrap", value.ToString());
}
}
[DOM("abbr")]
public string Abbr {
get {
return GetAttribute("abbr");
}
set {
SetAttribute("abbr", value);
}
}
[DOM("scope")]
public string Scope {
get {
return GetAttribute("scope");
}
set {
SetAttribute("scope", value);
}
}
[DOM("headers")]
public string Headers {
get {
return GetAttribute("headers");
}
set {
SetAttribute("headers", value);
}
}
[DOM("axis")]
public string Axis {
get {
return GetAttribute("axis");
}
set {
SetAttribute("axis", value);
}
}
protected internal override bool IsSpecial => true;
internal HTMLTableCellElement()
{
_name = "td";
}
}
}