Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a button or label inside a dynamically created table

Status
Not open for further replies.

newbiescooby

Technical User
Dec 5, 2006
13
0
0
NZ
Hi

I have the code:

function PopulateTableValue(row)
{
var row= row;
var tableRef = document.getElementById("Tbody");
var newRow = tableRef.insertRow(0);
for(var i = 0; i <= 0; i++)
{
var Content = ContentArray[row];
var newCell = newRow.insertCell(0);
var newText = document.createTextNode(Content);
newCell.appendChild(newText);
}
}

which builds a table with values from an array. I was wondering how i could change these labels into nested buttons or labels inside the table?
 
I tend to find working back from completed HTML is an easy way to approach this kind of problem. You might look at the Prototype node building functions too (prototype is a javascript framework).

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top