I have to make a data grid, in which data is shown directly from database.
I have done it by using PHP scripting with a while loop. ie. It would keep on fetching arrays from database and generate corresponding row one by one.
But with few rows its fine. As the number of rows and size of each row will increase, it will end up making it a huge HTML.
So I was thinking of using javascript to add rows. So I made a function to which I passed the row fields as arguments and it generates corrosponding row for the table.
The function is working fine if i call it manually by typing it in the address bar, but it is not adding rows when I call it on body's onload...
Where should I call that function?
[CODE=javascript]
function insRs() {
insR('a1','a2', 'a3','a4','a5', 'a6','a7');
insR('b1','b2', 'b3','b4','b5', 'b6','b7');
insR('c1','c2', 'c3','c4','c5', 'c6','c7');
insR('d1','d2', 'd3','d4','d5', 'd6','d7');
}[/CODE]
I have done it by using PHP scripting with a while loop. ie. It would keep on fetching arrays from database and generate corresponding row one by one.
But with few rows its fine. As the number of rows and size of each row will increase, it will end up making it a huge HTML.
So I was thinking of using javascript to add rows. So I made a function to which I passed the row fields as arguments and it generates corrosponding row for the table.
The function is working fine if i call it manually by typing it in the address bar, but it is not adding rows when I call it on body's onload...
Where should I call that function?
[CODE=javascript]
function insRs() {
insR('a1','a2', 'a3','a4','a5', 'a6','a7');
insR('b1','b2', 'b3','b4','b5', 'b6','b7');
insR('c1','c2', 'c3','c4','c5', 'c6','c7');
insR('d1','d2', 'd3','d4','d5', 'd6','d7');
}[/CODE]
Comment