Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Table Cells' Attributes: colspan and class
- From: javascript@xxxxxxxxxx (Peter Brunone)
- Subject: [Javascript] Table Cells' Attributes: colspan and class
- Date: Mon, 27 May 2002 18:13:56 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C205AA.444D96F0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Scott,
1. The attribute you want is colSpan (note the capital "S").
2. When scripting, this attribute is called className.
Neither of these is part of the style collection, but rather directly
subordinate to the object.
Additionally, you may find it useful to know that you can assign
multiple classes to an element (IE 5+) at design time with the following
syntax:
<ELEMENT CLASS = sClass [ sClass2 [ sClass3 ... ] ] ... >
Cheers,
Peter
-----Original Message-----
From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On
Behalf Of SnarfLT@xxxxxxx
Using JScript (this if for I.E. only) I would like to:
1. Change a table cell's 'colspan=' attribute
2. Change a table cell's 'class=' attribute
Each cell has its own id, so I tried
document.getElementById(cellID).colspan=
and
document.getElementById(cellID).class=
Neither worked, I think class is a reserved word in JScript though, but
I'm not sure. Maybe I can use document.getElementById(cellID).style._? ?
?_. Any ideas?
-Scott
------=_NextPart_000_0007_01C205AA.444D96F0
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2>Scott,</FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D337270823-27052002> <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>1. The attribute you want is colSpan =
(note the=20
capital "S").</FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002> <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>2. When scripting, this attribute is =
called=20
className. </FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D337270823-27052002> <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Neither of these is part of the style =
collection, but=20
rather directly subordinate to the object.</FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2> Additionally, you may find it useful to know =
that you=20
can assign multiple classes to an element (IE 5+) at design time with =
the=20
following syntax:</FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial><ELEMENT =
CLASS =3D sClass=20
[ sClass2 [ sClass3 ... ] ] ... ></FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT =
face=3DArial></FONT></SPAN> </DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2>Peter</FONT></SPAN></DIV>
<DIV><SPAN class=3D337270823-27052002><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<BLOCKQUOTE=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> =
javascript-admin@xxxxxxxxxx=20
[mailto:javascript-admin@xxxxxxxxxx]<B>On Behalf Of=20
</B>SnarfLT@xxxxxxx<BR><BR></FONT></DIV><FONT =
face=3Darial,helvetica><FONT=20
lang=3D0 face=3D"Courier New" size=3D2 FAMILY=3D"FIXED">Using JScript =
(this if for=20
I.E. only) I would like to:<BR><BR>1. Change a table cell's =
'colspan=3D'=20
attribute<BR>2. Change a table cell's 'class=3D' attribute<BR><BR>Each =
cell has=20
its own id, so I tried=20
=
document.getElementById(cellID).colspan=3D<BR>and<BR>document.getElementB=
yId(cellID).class=3D<BR><BR>Neither=20
worked, I think class is a reserved word in JScript though, but I'm =
not=20
sure. Maybe I can use =
document.getElementById(cellID).style._<U>? ?=20
?</U>_. Any ideas?<BR><BR>-Scott</FONT> =
</FONT></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0007_01C205AA.444D96F0--
- References:
- [Javascript] Table Cells' Attributes: colspan and class
- From: javascript@xxxxxxxxxx
- [Javascript] Table Cells' Attributes: colspan and class
- Prev by Date: [Javascript] Table Cells' Attributes: colspan and class
- Next by Date: [Javascript] Table Cells' Attributes: colspan and class
- Previous by thread: [Javascript] Table Cells' Attributes: colspan and class
- Next by thread: [Javascript] Table Cells' Attributes: colspan and class
- Index(es):