R
Raghuram Banda
Hi all,
I've created a table with Table Header and the table may or may not
contain any rows initially.
I've included a .css file in <head> section of my HTML script and I'm
creating rows to the table
dynamically using JavaScript (using DOM), and the problem is those
created bby DOM are not
following style sheet rules applicable for table rows and cells. But the
rows created from within
HTML script are following style sheet rules. The following is sample
which is used to create
dynamic row.
this.table = document.getElementById(tableId);
currentTb = document.createElement("TBODY");
currentRow = document.createElement("TR");
currentCell = document.createElement("TD");
currentElement = document.createTextNode("text");
currentCell.appendChild(currentElement);
currentElement = document.createElement("input");
currentElement.setAttribute("type", "text");
currentElement.setAttribute("name", "textBoxName");
currentElement.setAttribute("id", "textBoxId");
currentElement.setAttribute("size", "8");
currentCell.appendChild(currentElement);
currentElement = document.createElement("input");
currentElement.setAttribute("type", "checkbox");
currentElement.setAttribute("name", "checkBoxName");
currentElement.setAttribute("id", "checkBoxId");
currentElement.setAttribute("value", "t");
currentCell.appendChild(currentElement);
currentRow.appendChild(currentCell);
currentTb.appendChild(currentRow);
this.table.appendChild(currentTb);
Sorry for long mail
Thanks in advance
Raghuram Banda
I've created a table with Table Header and the table may or may not
contain any rows initially.
I've included a .css file in <head> section of my HTML script and I'm
creating rows to the table
dynamically using JavaScript (using DOM), and the problem is those
created bby DOM are not
following style sheet rules applicable for table rows and cells. But the
rows created from within
HTML script are following style sheet rules. The following is sample
which is used to create
dynamic row.
this.table = document.getElementById(tableId);
currentTb = document.createElement("TBODY");
currentRow = document.createElement("TR");
currentCell = document.createElement("TD");
currentElement = document.createTextNode("text");
currentCell.appendChild(currentElement);
currentElement = document.createElement("input");
currentElement.setAttribute("type", "text");
currentElement.setAttribute("name", "textBoxName");
currentElement.setAttribute("id", "textBoxId");
currentElement.setAttribute("size", "8");
currentCell.appendChild(currentElement);
currentElement = document.createElement("input");
currentElement.setAttribute("type", "checkbox");
currentElement.setAttribute("name", "checkBoxName");
currentElement.setAttribute("id", "checkBoxId");
currentElement.setAttribute("value", "t");
currentCell.appendChild(currentElement);
currentRow.appendChild(currentCell);
currentTb.appendChild(currentRow);
this.table.appendChild(currentTb);
Sorry for long mail
Thanks in advance
Raghuram Banda