
This interface is used to specify that the contained content is organized into a table with rows and columns.
Valid tags within a table include:
This element is a block element.
IHTMLTable Methods
HRESULT createCaption(
IHTMLTableCaption **caption
);
Creates a table caption. If no caption exists, this creates an empty table caption and adds it to the table, and returns a pointer to it. If captions already exist, this method returns a pointer to the first one in the list.
See also deleteCaption
HRESULT createTFoot(
IDispatch **foot
);
Creates a TFoot for the table. If a table foot already exists, this returns a pointer to it. Otherwise, an empty foot is created and added to a table, and a pointer to the empty foot is returned.
See also deleteTFoot
HRESULT createTHead(
IDispatch **head
);
Creates a THead for the table. When a table head already exists, this will return a pointer to it. If a table head doesn't exist, an empty table head is created and the pointer to that is returned.
See also deleteTHead
HRESULT deleteCaption(
void
);
Deletes the caption from a table. If there are multiple captions in the table, this method deletes the first caption and all its contents from the table.
See also createCaption
HRESULT deleteRow(
long index
);
Removes the row indicated by the value of the zero-based index parameter from this table section.
See also insertRow
HRESULT deleteTFoot(
void
);
Deletes a TFoot from the table. If there is a foot, this removes it and all its contents from the table. If multiple TFoots are defined, the next one in source order is promoted as the TFoot of the table.
See also createTFoot
HRESULT deleteTHead(
void
);
Deletes a THead from the table. If there is a head, this method removes it and all its contents from the table. If other THeads had been defined, the next one in source order is now promoted to the THead of the table.
See also createTHead
HRESULT get_align(
BSTR *p
);
Retrieves how the table should be aligned.
| center | Aligns to the center. |
| left | Aligns to the left edge. This is the default value. |
| right | Aligns to the right edge. |
See also put_align
HRESULT get_background(
BSTR *p
);
Retrieves the current background picture for the table, if any. The picture is tiled behind the text and graphics in the table.
See also put_background
HRESULT get_bgColor(
VARIANT *p
);
Retrieves the current background color of the table.
See also put_bgColor
HRESULT get_border(
VARIANT *p
);
Retrieves the border color and must be used with the border property, except for frames. The color can be one of the color names or values given in the Color Table reference documentation.
See also put_border
HRESULT get_borderColor(
VARIANT *p
);
Retrieves the border color and must be used with the border property.
See also put_borderColor
HRESULT get_borderColorDark(
VARIANT *p
);
Retrieves independent border color control over one of the two colors used to draw a 3-D border, opposite of borderColorLight, and must be used with the border property.
See also put_borderColorDark
HRESULT get_borderColorLight(
VARIANT *p
);
Retrieves independent border color control over one of the two colors used to draw a 3-D border, opposite of borderColorDark, and must be used with the border property.
See also put_borderColorLight
HRESULT get_caption(
IHTMLTableCaption **p
);
Returns an IHTMLTableCaption pointer to the first caption in the table. If the table does not contain a caption, NULL is returned.
HRESULT get_cellPadding(
VARIANT *p
);
Retrieves the amount of space between the border of the cell and the contents of the cell.
See also put_cellPadding
HRESULT get_cellSpacing(
VARIANT *p
);
Retrieves the amount of space between cells in a table.
See also put_cellSpacing
HRESULT get_cols(
long *p
);
Retrieves the number of columns in the table.
See also put_cols
HRESULT get_dataPageSize(
long *p
);
Retrieves the number of records displayed in a databound repeated table.
Use the nextPage and previousPage methods to display the subsequent and previous number of records in the table.
See also put_dataPageSize
HRESULT get_frame(
BSTR *p
);
Retrieves a description of the border frame around the table.
| above | Displays a border on the top side of the border frame. |
| below | Displays a border on the bottom side of the table frame. |
| border | Displays a border on all sides of the table frame. |
| box | Displays a border on all sides of the table frame. |
| insides | Displays a border on the top and bottom sides of the table frame. |
| lhs | Displays a border on the left side of the table frame. |
| rhs | Displays a border on the right side of the table frame. |
| void | Removes all outside table borders. |
| vsides | Displays a border on the left and right sides of the table frame. |
The default value for this property is "void".
See also put_frame
HRESULT get_height(
VARIANT *p
);
Retrieves the height of the table, in pixels.
If the value of the corresponding HTML attribute was set using a percentage, this property specifies the height, in pixels, represented by that percentage.
See also put_height
HRESULT get_onreadystatechange(
VARIANT *p
);
Retrieves the inline script associated with the onreadystatechange event for the table element. This script is executed when the onreadystatechange event is fired.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also put_onreadystatechange
HRESULT get_readyState(
BSTR *p
);
Returns the readyState enumeration string for the table's current ready state.
HRESULT get_rows(
IHTMLElementCollection **p
);
Retrieves a collection of all rows in the table. This is a collection of all the TR elements defined in the THEAD, TBODY, and TFOOT elements of the table.
HRESULT get_rules(
BSTR *p
);
Retrieves which dividing lines are displayed (inner borders).
| all | Displays a border on all rows and columns. |
| cols | Displays borders between all table columns. |
| groups | Displays horizontal borders between all table groups. Groups are specified by the THEAD, TBODY, TFOOT, and COLGROUP elements. |
| none | Removes all interior table borders. |
| rows | Displays horizontal borders between all table rows. |
See also put_rules
HRESULT get_tBodies(
IHTMLElementCollection **p
);
Returns an IHTMLTableSection pointer to all the table bodies in this table. The length of this collection is the count of bodies returned.
HRESULT get_tFoot(
IHTMLTableSection **p
);
Returns an IHTMLTableSection pointer to the foot section of a table. It returns NULL if there isn't one. If multiple table foots are listed in an HTML document, only the first one is treated as the foot of the table.
See also get_tHead
HRESULT get_tHead(
IHTMLTableSection **p
);
Returns an IHTMLTableSection pointer to the head section of a table. It returns NULL if there isn't one. If multiple table heads are listed in an HTML document, only the first one is treated as the head of the table.
See also get_tFoot
HRESULT get_width(
VARIANT *p
);
Retrieves the width of the table, in pixels.
This read-only property is an integer value. Although an HTML author can specify the width as a percentage, this property always specifies the width in pixels.
See also put_width
HRESULT insertRow(
long index,
IDispatch **row
);
Inserts an empty row into the table section. The row is added at the position indicated by the zero-based index provided. For example, passing in 1 adds the row between 0 and 1, thus becoming the row with index 1. Passing in -1 or the size of the collection causes the row to be appended.
See also deleteRow
HRESULT nextPage(
void
);
Displays the next block of records in a repeated databound table. The number of records is determined by the dataPageSize property on the TABLE element.
See also previousPage
HRESULT previousPage(void);
Displays the previous block of records in a repeated databound table. The number of records is determined by the dataPageSize property on the TABLE element.
See also nextPage
HRESULT put_align(
BSTR v
);
Sets how the table should be aligned.
| center | Aligns to the center. |
| left | Aligns to the left edge. This is the default value. |
| right | Aligns to the right edge. |
See also get_align
HRESULT put_background(
BSTR v
);
Sets a background picture for the table. The picture is tiled behind the text and graphics in the table.
See also get_background
HRESULT put_bgColor(
VARIANT v
);
Sets the background color of the table.
See also get_bgColor
HRESULT put_border(
VARIANT v
);
Sets the border color and must be used with the border property, except for frames.
See also get_border
HRESULT put_borderColor(
VARIANT v
);
Sets the border color and must be used with the border property.
See also get_borderColor
HRESULT put_borderColorDark(
VARIANT v
);
Sets independent border color control over one of the two colors used to draw a 3-D border, opposite of borderColorLight, and must be used with the border property.
See also get_borderColorDark
HRESULT put_borderColorLight(
VARIANT v
);
Sets independent border color control over one of the two colors used to draw a 3-D border, opposite of borderColorDark, and must be used with the border property.
See also get_borderColorLight
HRESULT put_cellPadding(
VARIANT v
);
Sets the amount of space between the border of the cell and the contents of the cell.
See also get_cellPadding
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.