001: /*
002: * Copyright (c) 2000 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
010: * details.
011: */
012:
013: package org.w3c.dom.html;
014:
015: import org.w3c.dom.DOMException;
016:
017: /**
018: * The create* and delete* methods on the table allow authors to construct
019: * and modify tables. HTML 4.0 specifies that only one of each of the
020: * <code>CAPTION</code> , <code>THEAD</code> , and <code>TFOOT</code>
021: * elements may exist in a table. Therefore, if one exists, and the
022: * createTHead() or createTFoot() method is called, the method returns the
023: * existing THead or TFoot element. See the TABLE element definition in HTML
024: * 4.0.
025: * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
026: */
027: public interface HTMLTableElement extends HTMLElement {
028: /**
029: * Returns the table's <code>CAPTION</code> , or void if none exists.
030: */
031: public HTMLTableCaptionElement getCaption();
032:
033: public void setCaption(HTMLTableCaptionElement caption);
034:
035: /**
036: * Returns the table's <code>THEAD</code> , or <code>null</code> if none
037: * exists.
038: */
039: public HTMLTableSectionElement getTHead();
040:
041: public void setTHead(HTMLTableSectionElement tHead);
042:
043: /**
044: * Returns the table's <code>TFOOT</code> , or <code>null</code> if none
045: * exists.
046: */
047: public HTMLTableSectionElement getTFoot();
048:
049: public void setTFoot(HTMLTableSectionElement tFoot);
050:
051: /**
052: * Returns a collection of all the rows in the table, including all in
053: * <code>THEAD</code> , <code>TFOOT</code> , all <code>TBODY</code>
054: * elements.
055: */
056: public HTMLCollection getRows();
057:
058: /**
059: * Returns a collection of the defined table bodies.
060: */
061: public HTMLCollection getTBodies();
062:
063: /**
064: * Specifies the table's position with respect to the rest of the
065: * document. See the align attribute definition in HTML 4.0. This
066: * attribute is deprecated in HTML 4.0.
067: */
068: public String getAlign();
069:
070: public void setAlign(String align);
071:
072: /**
073: * Cell background color. See the bgcolor attribute definition in HTML
074: * 4.0. This attribute is deprecated in HTML 4.0.
075: */
076: public String getBgColor();
077:
078: public void setBgColor(String bgColor);
079:
080: /**
081: * The width of the border around the table. See the border attribute
082: * definition in HTML 4.0.
083: */
084: public String getBorder();
085:
086: public void setBorder(String border);
087:
088: /**
089: * Specifies the horizontal and vertical space between cell content and
090: * cell borders. See the cellpadding attribute definition in HTML 4.0.
091: */
092: public String getCellPadding();
093:
094: public void setCellPadding(String cellPadding);
095:
096: /**
097: * Specifies the horizontal and vertical separation between cells. See
098: * the cellspacing attribute definition in HTML 4.0.
099: */
100: public String getCellSpacing();
101:
102: public void setCellSpacing(String cellSpacing);
103:
104: /**
105: * Specifies which external table borders to render. See the frame
106: * attribute definition in HTML 4.0.
107: */
108: public String getFrame();
109:
110: public void setFrame(String frame);
111:
112: /**
113: * Specifies which internal table borders to render. See the rules
114: * attribute definition in HTML 4.0.
115: */
116: public String getRules();
117:
118: public void setRules(String rules);
119:
120: /**
121: * Description about the purpose or structure of a table. See the
122: * summary attribute definition in HTML 4.0.
123: */
124: public String getSummary();
125:
126: public void setSummary(String summary);
127:
128: /**
129: * Specifies the desired table width. See the width attribute definition
130: * in HTML 4.0.
131: */
132: public String getWidth();
133:
134: public void setWidth(String width);
135:
136: /**
137: * Create a table header row or return an existing one.
138: * @return A new table header element (<code>THEAD</code> ).
139: */
140: public HTMLElement createTHead();
141:
142: /**
143: * Delete the header from the table, if one exists.
144: */
145: public void deleteTHead();
146:
147: /**
148: * Create a table footer row or return an existing one.
149: * @return A footer element (<code>TFOOT</code> ).
150: */
151: public HTMLElement createTFoot();
152:
153: /**
154: * Delete the footer from the table, if one exists.
155: */
156: public void deleteTFoot();
157:
158: /**
159: * Create a new table caption object or return an existing one.
160: * @return A <code>CAPTION</code> element.
161: */
162: public HTMLElement createCaption();
163:
164: /**
165: * Delete the table caption, if one exists.
166: */
167: public void deleteCaption();
168:
169: /**
170: * Insert a new empty row in the table. The new row is inserted
171: * immediately before and in the same section as the current
172: * <code>index</code> th row in the table. If <code>index</code> is equal
173: * to the number of rows, the new row is appended. In addition, when the
174: * table is empty the row is inserted into a <code>TBODY</code> which is
175: * created and inserted into the table. Note. A table row cannot be empty
176: * according to HTML 4.0 Recommendation.
177: * @param index The row number where to insert a new row. This index
178: * starts from 0 and is relative to all the rows contained inside the
179: * table, regardless of section parentage.
180: * @return The newly created row.
181: * @exception DOMException
182: * INDEX_SIZE_ERR: Raised if the specified index is greater than the
183: * number of rows or if the index is negative.
184: */
185: public HTMLElement insertRow(int index) throws DOMException;
186:
187: /**
188: * Delete a table row.
189: * @param index The index of the row to be deleted. This index starts
190: * from 0 and is relative to all the rows contained inside the table,
191: * regardless of section parentage.
192: * @exception DOMException
193: * INDEX_SIZE_ERR: Raised if the specified index is greater than or
194: * equal to the number of rows or if the index is negative.
195: */
196: public void deleteRow(int index) throws DOMException;
197:
198: }
|