3.2.0

Multiple Cells in a Table Row

Hi,

I'm trying display a table with 1 row. The row contains 2 cells. I have modified slightly the example code provided in the documentation for 'AW.HTML.TABLE', however, I can't get both cells to display at once.

Am I misinterpreting something here..??

<script>
var table = new AW.HTML.TABLE;
var row = new AW.HTML.TR;

var cell1 = new AW.HTML.TD;
var cell2 = new AW.HTML.TD;

cell1.setContent("html", "abc");
cell2.setContent("html", "def");

row.setContent("cell", cell1);
row.setContent("cell", cell2);

table.setContent("row", row);
table.setAttribute("border", "1");
document.write(table);

</script>
Martin
March 30,
The name argument in setContent() method is a unique name of the content item which allows referring or replacing the same content later. In your code you should use different names for cell1 and cell2 otherwise you simply overwrite the same item twice.

row.setContent("cell1", cell1);
row.setContent("cell2", cell2);

Alex (ActiveWidgets)
March 31,

This topic is archived.

See also:


Back to support forum