1998-10-14 16:35:15 +00:00
|
|
|
|
1998-10-09 19:59:45 +00:00
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
|
|
<SCRIPT>
|
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function insertCaption() {
|
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var caption = document.createElement("CAPTION", null);
|
1998-10-19 23:43:06 +00:00
|
|
|
var text = document.createTextNode("here is the new caption text\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
caption.appendChild(text);
|
|
|
|
table.appendChild(caption);
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteCaption() {
|
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var caption = document.getElementsByTagName("CAPTION")[0];
|
|
|
|
table.removeChild(caption);
|
|
|
|
}
|
1998-10-09 19:59:45 +00:00
|
|
|
|
1998-10-14 22:51:50 +00:00
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function insertColGroup() {
|
1998-10-14 22:51:50 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var refColGroup = document.getElementsByTagName("COLGROUP")[0];
|
|
|
|
var colGroup = document.createElement("COLGROUP", null);
|
|
|
|
colGroup.width=200;
|
|
|
|
colGroup.span=1;
|
|
|
|
table.insertBefore(colGroup, refColGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: inserted COLGROUP with span=1 width=200 as first colgroup in table\n");
|
1998-10-14 22:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function appendColGroup() {
|
1998-10-14 16:35:15 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var colGroup = document.createElement("COLGROUP", null);
|
1998-10-14 22:51:50 +00:00
|
|
|
colGroup.width=300;
|
|
|
|
colGroup.span=1;
|
1998-10-14 16:35:15 +00:00
|
|
|
table.appendChild(colGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: appended COLGROUP with span=1 width=300\n");
|
1998-10-09 19:59:45 +00:00
|
|
|
}
|
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function deleteColGroup() {
|
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var colGroup = document.getElementsByTagName("COLGROUP")[0];
|
|
|
|
table.removeChild(colGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: deleted first COLGROUP\n");
|
1998-10-09 19:59:45 +00:00
|
|
|
}
|
|
|
|
|
1998-10-14 22:51:50 +00:00
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function insertCol() {
|
1998-10-14 22:51:50 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var refCol = table.getElementsByTagName("COL")[0];
|
|
|
|
var col = document.createElement("COL", null);
|
|
|
|
col.width=200;
|
|
|
|
col.span=1;
|
|
|
|
table.insertBefore(col, refCol);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: inserted COL with span=1 width=200 as first col in first col group\n");
|
1998-10-14 22:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function appendCol() {
|
1998-10-14 16:35:15 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var col = document.createElement("COL", null);
|
|
|
|
table.appendChild(col);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: appended COL with span=1 width=300\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
}
|
1998-10-09 19:59:45 +00:00
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function deleteCol() {
|
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var col = document.getElementsByTagName("COL")[0];
|
|
|
|
table.removeChild(col);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: deleted first COL in first COLGROUP\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
}
|
1998-10-09 19:59:45 +00:00
|
|
|
|
1998-10-15 07:46:16 +00:00
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function insertRowGroup() {
|
1998-10-15 07:46:16 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var refRowGroup = document.getElementsByTagName("TBODY")[0];
|
|
|
|
var rowGroup = document.createElement("TBODY", null);
|
|
|
|
table.insertBefore(rowGroup, refRowGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: inserted empty ROWGROUP as first rowgroup in table\n");
|
1998-10-15 07:46:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function appendRowGroup() {
|
1998-10-14 16:35:15 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var rowGroup = document.createElement("TBODY", null);
|
|
|
|
table.appendChild(rowGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: appended empty ROWGROUP\n");
|
1998-10-15 07:46:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function appendRowGroupWithContent() {
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("\nSCRIPT: starting appendRowGroupWithContent\n");
|
1998-10-15 07:46:16 +00:00
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var rowGroup = document.createElement("TBODY", null);
|
|
|
|
var row = document.createElement("TR", null);
|
|
|
|
var cell = document.createElement("TD", null);
|
1998-10-19 23:43:06 +00:00
|
|
|
var text = document.createTextNode("here is content in the cell from the script appendRowGroupWithContent\n");
|
1998-10-15 07:46:16 +00:00
|
|
|
cell.appendChild(text);
|
|
|
|
row.appendChild(cell);
|
|
|
|
rowGroup.appendChild(row);
|
|
|
|
table.appendChild(rowGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: appended ROWGROUP with 1 row and 1 cell\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function deleteRowGroup() {
|
|
|
|
var table = document.getElementsByTagName("TABLE")[0];
|
|
|
|
var rowGroup = document.getElementsByTagName("TBODY")[0];
|
|
|
|
table.removeChild(rowGroup);
|
1998-10-19 23:43:06 +00:00
|
|
|
dump("SCRIPT: deleted first ROWGROUP\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 23:43:06 +00:00
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
function insertRow() {
|
1998-10-19 23:43:06 +00:00
|
|
|
var rg = document.getElementsByTagName("TBODY")[0];
|
|
|
|
var refRow = document.getElementsByTagName("TR")[0];
|
|
|
|
var row = document.createElement("TR", null);
|
|
|
|
rg.insertBefore(row, refRow);
|
|
|
|
dump("SCRIPT: inserted empty ROW as first row in first rowgroup in table\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
function appendRow() {
|
|
|
|
var rg = document.getElementsByTagName("TBODY")[0];
|
1998-10-14 16:35:15 +00:00
|
|
|
var row = document.createElement("TR", null);
|
1998-10-19 23:43:06 +00:00
|
|
|
rg.appendChild(row);
|
|
|
|
dump("SCRIPT: appended empty ROW in first ROWGROUP\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
function appendRowWithContent() {
|
|
|
|
dump("\nSCRIPT: starting appendRowWithContent\n");
|
|
|
|
var rg = document.getElementsByTagName("TBODY")[0];
|
|
|
|
var row = document.createElement("TR", null);
|
|
|
|
var cell = document.createElement("TD", null);
|
|
|
|
var text = document.createTextNode("here is content in the cell from the script appendRowWithContent\n");
|
|
|
|
cell.appendChild(text);
|
|
|
|
row.appendChild(cell);
|
|
|
|
rg.appendChild(row);
|
|
|
|
dump("SCRIPT: appended ROW with 1 cell in first ROWGROUP\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function deleteRow() {
|
1998-10-19 23:43:06 +00:00
|
|
|
var rg = document.getElementsByTagName("TBODY")[0];
|
|
|
|
var row = document.getElementsByTagName("TR")[0];
|
|
|
|
rg.removeChild(row);
|
|
|
|
dump("SCRIPT: deleted first ROW in first ROWGROUP\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function insertCell() {
|
1998-10-14 16:35:15 +00:00
|
|
|
var row = document.getElementsByTagName("TR")[0];
|
1998-10-19 23:43:06 +00:00
|
|
|
var refCell = document.getElementsByTagName("TD")[0];
|
|
|
|
var cell = document.createElement("TD", null);
|
|
|
|
row.insertBefore(cell, refCell);
|
|
|
|
dump("SCRIPT: inserted empty Cell as first cell in first row\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
function appendCell() {
|
|
|
|
var row = document.getElementsByTagName("TR")[0];
|
|
|
|
var cell = document.createElement("TD", null);
|
|
|
|
row.appendChild(cell);
|
|
|
|
dump("SCRIPT: appended empty CELL in first ROW\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
function appendCellWithContent() {
|
|
|
|
var row = document.getElementsByTagName("TR")[0];
|
|
|
|
var cell = document.createElement("TD", null);
|
|
|
|
var text = document.createTextNode("here is content in the cell from the script appendRowWithContent\n");
|
|
|
|
cell.appendChild(text);
|
|
|
|
row.appendChild(cell);
|
|
|
|
dump("SCRIPT: appended CELL with text content in first ROW\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteCell() {
|
|
|
|
var row = document.getElementsByTagName("TR")[0];
|
|
|
|
var cell = document.getElementsByTagName("TD")[0];
|
|
|
|
row.removeChild(cell);
|
|
|
|
dump("SCRIPT: deleted first CELL in first ROW\n");
|
1998-10-14 16:35:15 +00:00
|
|
|
}
|
1998-10-09 19:59:45 +00:00
|
|
|
|
|
|
|
</SCRIPT>
|
|
|
|
</HEAD>
|
|
|
|
|
|
|
|
<BODY>
|
1998-10-14 16:35:15 +00:00
|
|
|
all delete buttons currently remove the first item of <type> found
|
1998-10-09 19:59:45 +00:00
|
|
|
<table border>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
1998-10-14 16:35:15 +00:00
|
|
|
<td>cell content</td>
|
1998-10-09 19:59:45 +00:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
1998-10-14 16:35:15 +00:00
|
|
|
|
|
|
|
<p>
|
1998-10-09 19:59:45 +00:00
|
|
|
<form>
|
1998-10-14 16:35:15 +00:00
|
|
|
<INPUT TYPE="button" NAME="Ins Caption" VALUE="InsertCaption" onClick="insertCaption()" width=100>
|
|
|
|
<INPUT TYPE="button" NAME="Del Caption" VALUE="DeleteCaption" onClick="deleteCaption()" width=100>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<INPUT TYPE="button" NAME="Ins ColGroup" VALUE="InsertCG" onClick="insertColGroup()" width=100>
|
1998-10-14 22:51:50 +00:00
|
|
|
<INPUT TYPE="button" NAME="App ColGroup" VALUE="AppendCG" onClick="appendColGroup()" width=100>
|
1998-10-14 16:35:15 +00:00
|
|
|
<INPUT TYPE="button" NAME="Del ColGroup" VALUE="DeleteCG" onClick="deleteColGroup()" width=100>
|
|
|
|
<br>
|
|
|
|
<INPUT TYPE="button" NAME="Ins Col" VALUE="InsertCol" onClick="insertCol()" width=100>
|
1998-10-14 22:51:50 +00:00
|
|
|
<INPUT TYPE="button" NAME="App Col" VALUE="AppendCol" onClick="appendCol()" width=100>
|
1998-10-14 16:35:15 +00:00
|
|
|
<INPUT TYPE="button" NAME="Del Col" VALUE="DeleteCol" onClick="deleteCol()" width=100>
|
|
|
|
<br>
|
|
|
|
<INPUT TYPE="button" NAME="Ins RowGroup" VALUE="InsertRG" onClick="insertRowGroup()" width=100>
|
1998-10-14 22:51:50 +00:00
|
|
|
<INPUT TYPE="button" NAME="App RowGroup" VALUE="AppendRG" onClick="appendRowGroup()" width=100>
|
1998-10-14 16:35:15 +00:00
|
|
|
<INPUT TYPE="button" NAME="Del RowGroup" VALUE="DeleteRG" onClick="deleteRowGroup()" width=100>
|
1998-10-15 07:46:16 +00:00
|
|
|
<INPUT TYPE="button" NAME="App RowGroup with content" VALUE="AppendRG with content" onClick="appendRowGroupWithContent()" width=100>
|
1998-10-14 16:35:15 +00:00
|
|
|
<br>
|
1998-10-14 22:51:50 +00:00
|
|
|
<INPUT TYPE="button" NAME="Ins Row" VALUE="InsertRow" onClick="insertRow()" width=100>
|
|
|
|
<INPUT TYPE="button" NAME="App Row" VALUE="AppendRow" onClick="appendRow()" width=100>
|
|
|
|
<INPUT TYPE="button" NAME="Del Row" VALUE="DeleteRow" onClick="deleteRow()" width=100>
|
1998-10-19 23:43:06 +00:00
|
|
|
<INPUT TYPE="button" NAME="App Row with content" VALUE="AppendRow with content" onClick="appendRowWithContent()" width=100>
|
|
|
|
<br>
|
|
|
|
<INPUT TYPE="button" NAME="Ins Cell" VALUE="InsertCell" onClick="insertCell()" width=100>
|
|
|
|
<INPUT TYPE="button" NAME="App Cell" VALUE="AppendCell" onClick="appendCell()" width=100>
|
|
|
|
<INPUT TYPE="button" NAME="Del Cell" VALUE="DeleteCell" onClick="deleteCell()" width=100>
|
|
|
|
<INPUT TYPE="button" NAME="App Cell with content" VALUE="AppendCell with content" onClick="appendCellWithContent()" width=100>
|
1998-10-14 16:35:15 +00:00
|
|
|
<br>
|
1998-10-09 19:59:45 +00:00
|
|
|
</form>
|
|
|
|
|
1998-10-14 16:35:15 +00:00
|
|
|
</BODY></HTML>
|
1998-10-09 19:59:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|