最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
How to Build Tables Dynamically(二)
时间:2022-06-30 09:57:12 编辑:袖梨 来源:一聚教程网
The following example uses the Table Object Model to create the example table used throughout this article.
Show Example
T LANGUAGE="JScript">
// Declare variables and create the header, footer, and caption.
var oTHead = oTable.createTHead();
var oTFoot = oTable.createTFoot();
var oCaption = oTable.createCaption();
var oRow, oCell;
var i, j;
// Declare stock data that would normally be retrieved from a stock Web site.
var heading = new Array;
heading[0] = "Stock symbol";
heading[1] = "High";
heading[2] = "Low";
heading[3] = "Close";
var stock = new Array;
stock["0,0"] = "ABCD";
stock["0,1"] = "88.625";
stock["0,2"] = "85.50";
stock["0,3"] = "85.81";
stock["1,0"] = "EFGH";
stock["1,1"] = "102.75";
stock["1,2"] = "97.50";
stock["1,3"] = "100.063";
stock["2,0"] = "IJKL";
stock["2,1"] = "56.125";
stock["2,2"] = "54.50";
stock["2,3"] = "55.688";
stock["3,0"] = "MNOP";
stock["3,1"] = "71.75";
stock["3,2"] = "69.00";
stock["3,3"] = "69.00";
// Insert a row into the header.
oRow = oTHead.insertRow();
oTHead.bgColor = "lightskyblue";
// Insert cells into the header row.
for (i=0; i<4; i++)
{
oCell = oRow.insertCell();
oCell.align = "center";
Show Example
// Declare variables and create the header, footer, and caption.
var oTHead = oTable.createTHead();
var oTFoot = oTable.createTFoot();
var oCaption = oTable.createCaption();
var oRow, oCell;
var i, j;
// Declare stock data that would normally be retrieved from a stock Web site.
var heading = new Array;
heading[0] = "Stock symbol";
heading[1] = "High";
heading[2] = "Low";
heading[3] = "Close";
var stock = new Array;
stock["0,0"] = "ABCD";
stock["0,1"] = "88.625";
stock["0,2"] = "85.50";
stock["0,3"] = "85.81";
stock["1,0"] = "EFGH";
stock["1,1"] = "102.75";
stock["1,2"] = "97.50";
stock["1,3"] = "100.063";
stock["2,0"] = "IJKL";
stock["2,1"] = "56.125";
stock["2,2"] = "54.50";
stock["2,3"] = "55.688";
stock["3,0"] = "MNOP";
stock["3,1"] = "71.75";
stock["3,2"] = "69.00";
stock["3,3"] = "69.00";
// Insert a row into the header.
oRow = oTHead.insertRow();
oTHead.bgColor = "lightskyblue";
// Insert cells into the header row.
for (i=0; i<4; i++)
{
oCell = oRow.insertCell();
oCell.align = "center";
相关文章
- 以下哪种非遗技艺是用针在纸上绣画 蚂蚁新村11月21日答案 11-22
- 江南百景图听风塔怎么样 11-22
- 原神恰斯卡圣遗物怎么搭配 11-22
- 2024年霸王茶姬11月22日口令是什么 2024.11.22霸王茶姬口令介绍 11-22
- 光遇11.21季节蜡烛在哪里 光遇11月21日季节蜡烛位置攻略 11-22
- 光遇11.21大蜡烛在哪里 光遇11月21日大蜡烛位置攻略 11-22