J
jainharsh
Hi Guyz,
I am trying to make a dynamic table which will automatically update
after running a query.
My Table contains 4 columns.
I am trying to update the table by adding rows of information to it.
But i am able to add only one column, how can i insert 4 columns and
make the table resize automatically.
My Function.
function getRoomDetails()
{
var table = document.getElementById('roomTable');
var row = document.createElement("tr");
var cell = document.createElement("td");
var cell2 = document.createElement("td");
var cell3 = document.createElement("td");
var cell4 = document.createElement("td");
var cellText = document.createTextNode("Column 1");
var cellText1 = document.createTextNode("Column 2");
var cellText2 = document.createTextNode("Column 3");
var cellText3 = document.createTextNode("Column 4");
cell.appendChild(cellText);
cell1.appendChild(cellText1);
cell2.appendChild(cellText2);
cell3.appendChild(cellText4);
row.appendChild(cell);
row.appendChild(cell2);
row.appendChild(cell3);
row.appendChild(cell5);
table.appendChild(row);
}
any help would be appreciated.
Thanks,
Hj
I am trying to make a dynamic table which will automatically update
after running a query.
My Table contains 4 columns.
I am trying to update the table by adding rows of information to it.
But i am able to add only one column, how can i insert 4 columns and
make the table resize automatically.
My Function.
function getRoomDetails()
{
var table = document.getElementById('roomTable');
var row = document.createElement("tr");
var cell = document.createElement("td");
var cell2 = document.createElement("td");
var cell3 = document.createElement("td");
var cell4 = document.createElement("td");
var cellText = document.createTextNode("Column 1");
var cellText1 = document.createTextNode("Column 2");
var cellText2 = document.createTextNode("Column 3");
var cellText3 = document.createTextNode("Column 4");
cell.appendChild(cellText);
cell1.appendChild(cellText1);
cell2.appendChild(cellText2);
cell3.appendChild(cellText4);
row.appendChild(cell);
row.appendChild(cell2);
row.appendChild(cell3);
row.appendChild(cell5);
table.appendChild(row);
}
any help would be appreciated.
Thanks,
Hj