Hello Anoop, you can easily add a column into a table dynamically. The below coding will help you i think so
[HTML]<html>
<head>
<script language="javas cript">
function drawTableD(plac e) {
if (document.creat eElement) {
var oTable = document.create Element('table' );
oTable.style.bo rder = '1px solid red';
var oTbody = document.create Element('tbody' );
var oRow = document.create Element('tr');
// Put 4 cells in the a row
for (var i=0; i<4; i++) {
var oCell = document.create Element('td');
var oTxt = document.create TextNode('a cell');
oCell.style.bor der = '1px solid blue';
oCell.appendChi ld(oTxt);
oRow.appendChil d(oCell);
}
changed thread title ... please be sure to use a proper thread title for your post ... read this section of the posting guidelines ...
kind regards
MOD
I am extremely sorry Mr. Gits, I had entered mistakenly entered how to create column dynamically in a table, but the thing is I had given the code which first creates a row dynamically and append the column to it.
I am extremely sorry Mr. Gits, I had entered mistakenly entered how to create column dynamically in a table, but the thing is I had given the code which first creates a row dynamically and append the column to it.
I apologize for my mistake I am really sorry
no need to apologize for :) ... i just saw that was what the OP wanted ... but i think he/she should provide more information since we should know whether it is an existing table or a new one ... so that we would have to deal with some colspan etc.?
Comment