TABLE>
How to generate a table of 3 lines 3 column?
Example 1:
VAR ID = 0;
Function addTable (row) {
FOR (var i = 0; i <= row; i )
Tr = TableForm.inSertrow ();
TD = tr.insertcell ();
TD.ID = "TD1" i;
TD.ID = "TD2" i;
TD.ID = "TD3" i;
EVAL ("TD1" ID ". Height = '22'); / / can set height or other attributes for the table
}
script>
Generate effect:
If you add a control in the cell?
EVAL ("TD0" ID ". Height = '22'); / / can set height or other attributes for the table
An example of the last line continues:
EVAL ("TD0" ID ". InnerHTML = STR (/" strtds0 / ")")
EVAL ("TD1" ID ". InnerHTML = STR (/" strTDS1 / ")")
EVAL ("TD2" ID ". InnerHTML = STR (/" strtds2 / ")")
STR Write:
Function STR (STR) {
Var stratds0 = "
Var stratds1 = " " Title: "
"Address: "
Var stratds2 = ""
" - Select Category - Option>
" Topic option>"
" Photo News option>"
" all news option>"
" forum option>"
" Select>"
""
IF (str == "stratds1")
Return (strTDS1);
IF (str == "stratds2))
Return (StrtDS2);
IF (str == "stratds0))
Return (strTds0);
Innerhtml is to add HTML code to the label represented by the ID, Note that the attribute in Table and TR is read-only attribute TD to modify!
How to delete a line?
TableForm.deleterow;
How to traverse?
TableForm.Rows.Length
Number of lines get the table!
How to access TD in the line?
TableForm.Rows.ROMS (second line). Cell (column). Property If an Alert (TableForm.Rows (0) .cle (0) .id) output value is 'TD00'