IHTMLTable

IHTMLTable


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
put_cols   get_cols   put_border  
get_border put_frame   get_frame  
put_rules   get_rules put_cellSpacing  
get_cellSpacing   put_cellPadding   get_cellPadding
put_background   get_background   put_bgColor  
get_bgColor put_borderColor   get_borderColor  
put_borderColorLight   get_borderColorLight put_borderColorDark  
get_borderColorDark   put_align   get_align
refresh   get_rows   put_width  
get_width put_height   get_height  
put_dataPageSize   get_dataPageSize nextPage  
previousPage   get_tHead   get_tFoot
get_tBodies   get_caption   createTHead  
deleteTHead createTFoot   deleteTFoot  
createCaption   deleteCaption insertRow  
deleteRow   get_readyState   put_onreadystatechange
get_onreadystatechange  

IHTMLTable::createCaption

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.

caption
Address of a pointer to a variable of IHTMLTableCaption type.

See also deleteCaption

IHTMLTable::createTFoot

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.

foot
Address of a pointer to an IDispatch interface.

See also deleteTFoot

IHTMLTable::createTHead

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.

head
Address of a pointer to an IDispatch interface.

See also deleteTHead

IHTMLTable::deleteCaption

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

IHTMLTable::deleteRow

HRESULT deleteRow(
    long index 
);

Removes the row indicated by the value of the zero-based index parameter from this table section.

index
Long integer value specifying the index position in the table.

See also insertRow

IHTMLTable::deleteTFoot

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

IHTMLTable::deleteTHead

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

IHTMLTable::get_align

HRESULT get_align(
    BSTR *p 
);

Retrieves how the table should be aligned.

p
Address of a variable that receives one of these values:
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

IHTMLTable::get_background

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.

p
Address of a variable that receives the URL of the background picture.

See also put_background

IHTMLTable::get_bgColor

HRESULT get_bgColor(
    VARIANT *p 
);

Retrieves the current background color of the table.

p
Address of a variable that receives the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also put_bgColor

IHTMLTable::get_border

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.

p
Address of a VARIANT structure that receives one of the color names or values given in the Color Table reference documentation.

See also put_border

IHTMLTable::get_borderColor

HRESULT get_borderColor( 
    VARIANT *p 
);

Retrieves the border color and must be used with the border property.

p
Address of a variable that receives the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also put_borderColor

IHTMLTable::get_borderColorDark

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.

p
Address of a variable that receives the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also put_borderColorDark

IHTMLTable::get_borderColorLight

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.

p
Address of a variable that receives the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also put_borderColorLight

IHTMLTable::get_caption

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.

p
Address of a pointer to the IHTMLTableCaption interface of the element.

IHTMLTable::get_cellPadding

HRESULT get_cellPadding( 
    VARIANT *p 
);

Retrieves the amount of space between the border of the cell and the contents of the cell.

p
Address of a VARIANT structure that receives the cell padding.

See also put_cellPadding

IHTMLTable::get_cellSpacing

HRESULT get_cellSpacing(
    VARIANT *p 
);

Retrieves the amount of space between cells in a table.

p
Address of a VARIANT structure that receives the cell spacing.

See also put_cellSpacing

IHTMLTable::get_cols

HRESULT get_cols(
    long *p 
);

Retrieves the number of columns in the table.

p
Address of a long integer that receives the number of columns.

See also put_cols

IHTMLTable::get_dataPageSize

HRESULT get_dataPageSize(
    long *p 
);

Retrieves the number of records displayed in a databound repeated table.

p
Address of a long integer that receives the number of records.

Use the nextPage and previousPage methods to display the subsequent and previous number of records in the table.

See also put_dataPageSize

IHTMLTable::get_frame

HRESULT get_frame(
    BSTR *p 
);

Retrieves a description of the border frame around the table.

p
Address of a string variable that receives one of these strings:
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

IHTMLTable::get_height

HRESULT get_height(
    VARIANT *p 
);

Retrieves the height of the table, in pixels.

p
Address of a VARIANT structure that receives the height.

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

IHTMLTable::get_onreadystatechange

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.

p
Address of a VARIANT structure that contains the script.

See also put_onreadystatechange

IHTMLTable::get_readyState

HRESULT get_readyState(
    BSTR *p 
);

Returns the readyState enumeration string for the table's current ready state.

p
Address of a string variable that receives the enumeration.

IHTMLTable::get_rows

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.

p
Address of a pointer to the IHTMLElementCollection interface of the table.

IHTMLTable::get_rules

HRESULT get_rules(
    BSTR *p 
);

Retrieves which dividing lines are displayed (inner borders).

p
Address of a string variable that receives one of these values:
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

IHTMLTable::get_tBodies

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.

p
Address of a pointer to the IHTMLElementCollection interface of the table.

IHTMLTable::get_tFoot

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.

p
Address of a pointer to the IHTMLTableSection interface of the table.

See also get_tHead

IHTMLTable::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.

p
Address of a pointer to the IHTMLTableSection interface of the table.

See also get_tFoot

IHTMLTable::get_width

HRESULT get_width(
    VARIANT *p 
);

Retrieves the width of the table, in pixels.

p
Address of a VARIANT structure that receives the width.

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

IHTMLTable::insertRow

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.

index
Long integer value that contains the index of the table row position.
row
Address of a pointer to an IDispatch interface.

See also deleteRow

IHTMLTable::nextPage

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

IHTMLTable::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

IHTMLTable::put_align

HRESULT put_align( 
    BSTR v 
);

Sets how the table should be aligned.

v
String specifying the alignment. Can be one of these values:
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

IHTMLTable::put_background

HRESULT put_background( 
    BSTR v 
);

Sets a background picture for the table. The picture is tiled behind the text and graphics in the table.

v
String specifying the URL of the background picture.

See also get_background

IHTMLTable::put_bgColor

HRESULT put_bgColor(
    VARIANT v 
);

Sets the background color of the table.

v
String or value specifying the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also get_bgColor

IHTMLTable::put_border

HRESULT put_border(
    VARIANT v 
);

Sets the border color and must be used with the border property, except for frames.

v
VARIANT structure that contains either a string or numeric value specifying the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also get_border

IHTMLTable::put_borderColor

HRESULT put_borderColor( 
    VARIANT v 
);

Sets the border color and must be used with the border property.

v
String or value specifying the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also get_borderColor

IHTMLTable::put_borderColorDark

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.

v
String or value specifying the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also get_borderColorDark

IHTMLTable::put_borderColorLight

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.

v
String or value specifying the color. The color can be one of the color names or values given in the Color Table reference documentation.

See also get_borderColorLight

IHTMLTable::put_cellPadding

HRESULT put_cellPadding(
    VARIANT v 
);

Sets the amount of space between the border of the cell and the contents of the cell.

v
VARIANT structure that contains either a string or value specifying the cell padding.

See also get_cellPadding

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.