KDE 4.9 PyKDE API Reference

- KDE's Python API

# HTMLTableElement Class Reference

`from PyKDE4.khtml import *`

Inherits: DOM.HTMLElement → DOM.Element → DOM.Node
Namespace: DOM

## Detailed Description

The create* and delete* methods on the table allow authors to construct and modify tables. HTML 4.0 specifies that only one of each of the CAPTION , THEAD , and TFOOT elements may exist in a table. Therefore, if one exists, and the createTHead() or createTFoot() method is called, the method returns the existing THead or TFoot element. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TABLE"> TABLE element definition in HTML 4.0.

## Methods

| __init__ (self)
| __init__ (self, DOM.HTMLTableElement other)
| __init__ (self, DOM.Node other)
DOM.DOMString | align (self)
DOM.DOMString | bgColor (self)
DOM.DOMString | border (self)
DOM.HTMLTableCaptionElement | caption (self)
DOM.DOMString | cellPadding (self)
DOM.DOMString | cellSpacing (self)
DOM.HTMLElement | createCaption (self)
DOM.HTMLElement | createTFoot (self)
DOM.HTMLElement | createTHead (self)
| deleteCaption (self)
| deleteRow (self, long index)
| deleteTFoot (self)
| deleteTHead (self)
DOM.DOMString | frame (self)
DOM.HTMLElement | insertRow (self, long index)
DOM.HTMLCollection | rows (self)
DOM.DOMString | rules (self)
| setAlign (self, DOM.DOMString a0)
| setBgColor (self, DOM.DOMString a0)
| setBorder (self, DOM.DOMString a0)
| setCaption (self, DOM.HTMLTableCaptionElement a0)
| setCellPadding (self, DOM.DOMString a0)
| setCellSpacing (self, DOM.DOMString a0)
| setFrame (self, DOM.DOMString a0)
| setRules (self, DOM.DOMString a0)
| setSummary (self, DOM.DOMString a0)
| setTFoot (self, DOM.HTMLTableSectionElement a0)
| setTHead (self, DOM.HTMLTableSectionElement a0)
| setWidth (self, DOM.DOMString a0)
DOM.DOMString | summary (self)
DOM.HTMLCollection | tBodies (self)
DOM.HTMLTableSectionElement | tFoot (self)
DOM.HTMLTableSectionElement | tHead (self)
DOM.DOMString | width (self)

## Method Documentation

__init__ | ( |  | self ) |

__init__ | ( | self, |
|  | DOM.HTMLTableElement | other
| ) |  |  |

__init__ | ( | self, |
|  | DOM.Node | other
| ) |  |  |

DOM.DOMString align | ( |  | self ) |

Specifies the table's position with respect to the rest of the document. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TABLE"> align attribute definition in HTML 4.0. This attribute is deprecated in HTML 4.0.

DOM.DOMString bgColor | ( |  | self ) |

Cell background color. See the <a href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor"> bgcolor attribute definition in HTML 4.0. This attribute is deprecated in HTML 4.0.

DOM.DOMString border | ( |  | self ) |

The width of the border around the table. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-border-TABLE"> border attribute definition in HTML 4.0.

DOM.HTMLTableCaptionElement caption | ( |  | self ) |

Returns the table's CAPTION , or void if none exists.

DOM.DOMString cellPadding | ( |  | self ) |

Specifies the horizontal and vertical space between cell content and cell borders. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellpadding"> cellpadding attribute definition in HTML 4.0.

DOM.DOMString cellSpacing | ( |  | self ) |

Specifies the horizontal and vertical separation between cells. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellspacing"> cellspacing attribute definition in HTML 4.0.

DOM.HTMLElement createCaption | ( |  | self ) |

Create a new table caption object or return an existing one.

Returns:
  A CAPTION element.

DOM.HTMLElement createTFoot | ( |  | self ) |

Create a table footer row or return an existing one.

Returns:
  A footer element ( TFOOT ).

DOM.HTMLElement createTHead | ( |  | self ) |

Create a table header row or return an existing one.

Returns:
  A new table header element ( THEAD ).

deleteCaption | ( |  | self ) |

Delete the table caption, if one exists.

Returns:

deleteRow | ( | self, |
|  | long | index
| ) |  |  |

Delete a table row.

Parameters:

  | index | The index of the row to be deleted. This index starts from 0 and is relative to the logical order (not document order) of all the rows contained inside the table. If the index is -1 the last row in the table is deleted.

Returns:

deleteTFoot | ( |  | self ) |

Delete the footer from the table, if one exists.

Returns:

deleteTHead | ( |  | self ) |

Delete the header from the table, if one exists.

Returns:

DOM.DOMString frame | ( |  | self ) |

Specifies which external table borders to render. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-frame"> frame attribute definition in HTML 4.0.

DOM.HTMLElement insertRow | ( | self, |
|  | long | index
| ) |  |  |

Insert a new empty row in the table. The new row is inserted immediately before and in the same section as the current indexth row in the table. If index is -1 or equal to the number of rows, the new row is appended. In addition, when the table is empty the row is inserted into a TBODY which is created and inserted into the table. Note. A table row cannot be empty according to HTML 4.0 Recommendation.

Parameters:

  | index | The row number where to insert a new row. The index starts from 0 and is relative to the logical order (not document order) of all the rows contained inside the table.

Returns:
  The newly created row.

DOM.HTMLCollection rows | ( |  | self ) |

Returns a collection of all the rows in the table, including all in THEAD , TFOOT , all TBODY elements.

DOM.DOMString rules | ( |  | self ) |

Specifies which internal table borders to render. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-rules"> rules attribute definition in HTML 4.0.

setAlign | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see align

setBgColor | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see bgColor

setBorder | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see border

setCaption | ( | self, |
|  | DOM.HTMLTableCaptionElement | a0
| ) |  |  |

see caption

setCellPadding | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see cellPadding

setCellSpacing | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see cellSpacing

setFrame | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see frame

setRules | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see rules

setSummary | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see summary

setTFoot | ( | self, |
|  | DOM.HTMLTableSectionElement | a0
| ) |  |  |

see tFoot

setTHead | ( | self, |
|  | DOM.HTMLTableSectionElement | a0
| ) |  |  |

see tHead

setWidth | ( | self, |
|  | DOM.DOMString | a0
| ) |  |  |

see width

DOM.DOMString summary | ( |  | self ) |

Supplementary description about the purpose or structure of a table. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-summary"> summary attribute definition in HTML 4.0.

DOM.HTMLCollection tBodies | ( |  | self ) |

Returns a collection of the table bodies (including implicit ones).

DOM.HTMLTableSectionElement tFoot | ( |  | self ) |

Returns the table's TFOOT , or null if none exists.

DOM.HTMLTableSectionElement tHead | ( |  | self ) |

Returns the table's THEAD , or null if none exists.

DOM.DOMString width | ( |  | self ) |

Specifies the desired table width. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-TABLE"> width attribute definition in HTML 4.0.