代码片断var tableBody = gActiveEditor.createElementWithDefaults("tbody");
if (tableBody)
{
gTableElement.appendChild(tableBody); // Create necessary rows and cells for the table
for (var i = 0; i < gRows; i++)
{
var newRow = gActiveEditor.createElementWithDefaults("tr");
if (newRow)
{
tableBody.appendChild(newRow);
for (var j = 0; j < gColumns; j++)
{
var newCell = gActiveEditor.createElementWithDefaults("td");
if (newCell)
{
newRow.appendChild(newCell);
// 此处增加 width 属性,并设置其值 ,,查到方法
// void setAttribute ( nsIDOMElement element , AString attributestr , AString attvalue )
// 不好使,高人指点
}
}
}
}
}
if (tableBody)
{
gTableElement.appendChild(tableBody); // Create necessary rows and cells for the table
for (var i = 0; i < gRows; i++)
{
var newRow = gActiveEditor.createElementWithDefaults("tr");
if (newRow)
{
tableBody.appendChild(newRow);
for (var j = 0; j < gColumns; j++)
{
var newCell = gActiveEditor.createElementWithDefaults("td");
if (newCell)
{
newRow.appendChild(newCell);
// 此处增加 width 属性,并设置其值 ,,查到方法
// void setAttribute ( nsIDOMElement element , AString attributestr , AString attvalue )
// 不好使,高人指点
}
}
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货