Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to assign colspan to a table cell in javascript

Reply
Thread Tools

How to assign colspan to a table cell in javascript

 
 
manoj
Guest
Posts: n/a
 
      02-25-2008
Hi,

I am generating html table dynamically by javascript.
I want to access colspan properties of table cell.
What can be the way to achieve this?

The code snippet is :-

for(i=0;i<parms.length-1;i++)
{
var GrpNames = parms[i].split(',');

Row = window.tblvalue.insertRow();

Row.style.width='100%';
Row.align="right";

Cell = Row.insertCell();

Cell.colspan=' 2 ' //This code doesnt work

Cell.innerHTML="<a href='' style='Color:blue'
onclick='return
ShowCritGroupDetailList("+GrpNames[0]+")'>"+GrpNames[1]+"</
a>";

Cell = Row.insertCell();

Cell.innerHTML="<input type=checkbox name=chk_" + i +"
id="+GrpNames[0]+"; value='C'>";


}

 
Reply With Quote
 
 
 
 
Henry
Guest
Posts: n/a
 
      02-25-2008
On Feb 25, 9:12*am, manoj wrote:
> I am generating *html table dynamically by javascript.
> I want to access colspan properties of table cell.
> What can be the way to achieve this?

<snip>
> * * * * * *Cell.colspan=' 2 ' //This code doesnt work

<snip>
In case-sensitive javascript it is important to use the correct
sequence of upper and lower case letters in property names. In this
case the 'S' in 'span' should be a capital.

Cell.colSpan = 2;

(and the expectation would be that the value assigned should be
numeric and not a string.)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Table with Alternating Color Columns and Colspan cho.cabot HTML 3 11-13-2006 02:53 PM
Colspan - rowspan HTML Table Logix HTML 23 08-27-2004 09:28 PM
IE screws up table cell widths when colspan is used Glen K HTML 4 07-14-2004 02:46 PM
asp:table equivalent of colspan??? rob merritt ASP .Net Web Controls 1 04-18-2004 08:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57