It's very easy. Give the TD element an id: <td id="cellWhoseWidthIWantToChange" width="180px">Content : Img and Text</td>
Then, in your code (assuming IE): cellWhoseWidthIWantToChange.style.width 0
HTH, Bob Barrows
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
NicoAgenci wrote:
Hello,
Is it possible to change the width in a table with jvascript or dhtml
?
More details :
I have :
<table>
<tr>
<td width="">Content : Img and Text</td>
<td width="180px">Content : Img and Text</td>
</tr>
</table>
And i want to change the size of the second <td> (<td width="180px">)
with javascript or dhtml or css
It's very easy. Give the TD element an id:
<td id="cellWhoseWidthIWantToChange" width="180px">Content : Img and
Text</td>
Then, in your code (assuming IE):
cellWhoseWidthIWantToChange.style.width 0
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
It's very easy. Give the TD element an id: <td id="cellWhoseWidthIWantToChange" width="180px">Content : Img and Text</td>
Then, in your code (assuming IE): cellWhoseWidthIWantToChange.style.width 0
HTH, Bob Barrows
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Giedrius
"Bob Barrows" wrote in message news:
NicoAgenci wrote: > Hello, > > Is it possible to change the width in a table with jvascript or dhtml > ? > > More details : > > I have : > > <table> > <tr> > <td width="">Content : Img and Text</td> > <td width="180px">Content : Img and Text</td> > </tr> > </table> > > And i want to change the size of the second <td> (<td width="180px">) > with javascript or dhtml or css > > Have you do this one yet ??? > > Thanx, > Nico !
It's very easy. Give the TD element an id: <td id="cellWhoseWidthIWantToChange" width="180px">Content : Img and Text</td>
Then, in your code (assuming IE): cellWhoseWidthIWantToChange.style.width 0
I would recommend using document.getElementById('cellWhoseWidthIWantToChange').style.width 0 since it is the official standart and the code above doesn't always work correctly.
I had to rewrite half of my intranet application (based strictly on IE 5.5) once, because of that problem
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:umCnruhJEHA.2704@TK2MSFTNGP10.phx.gbl...
NicoAgenci wrote:
> Hello,
>
> Is it possible to change the width in a table with jvascript or dhtml
> ?
>
> More details :
>
> I have :
>
> <table>
> <tr>
> <td width="">Content : Img and Text</td>
> <td width="180px">Content : Img and Text</td>
> </tr>
> </table>
>
> And i want to change the size of the second <td> (<td width="180px">)
> with javascript or dhtml or css
>
> Have you do this one yet ???
>
> Thanx,
> Nico !
It's very easy. Give the TD element an id:
<td id="cellWhoseWidthIWantToChange" width="180px">Content : Img and
Text</td>
Then, in your code (assuming IE):
cellWhoseWidthIWantToChange.style.width 0
I would recommend using
document.getElementById('cellWhoseWidthIWantToChange').style.width 0
since it is the official standart and the code above doesn't always work
correctly.
I had to rewrite half of my intranet application (based strictly on IE 5.5)
once, because of that problem
NicoAgenci wrote: > Hello, > > Is it possible to change the width in a table with jvascript or dhtml > ? > > More details : > > I have : > > <table> > <tr> > <td width="">Content : Img and Text</td> > <td width="180px">Content : Img and Text</td> > </tr> > </table> > > And i want to change the size of the second <td> (<td width="180px">) > with javascript or dhtml or css > > Have you do this one yet ??? > > Thanx, > Nico !
It's very easy. Give the TD element an id: <td id="cellWhoseWidthIWantToChange" width="180px">Content : Img and Text</td>
Then, in your code (assuming IE): cellWhoseWidthIWantToChange.style.width 0
I would recommend using document.getElementById('cellWhoseWidthIWantToChange').style.width 0 since it is the official standart and the code above doesn't always work correctly.
I had to rewrite half of my intranet application (based strictly on IE 5.5) once, because of that problem
Bob Barrows
Giedrius wrote:
I would recommend using document.getElementById('cellWhoseWidthIWantToChange').style.width 0 since it is the official standart and the code above doesn't always work correctly.
I had to rewrite half of my intranet application (based strictly on IE 5.5) once, because of that problem
You probably had that problem because you had a FORM tag enclosing the elements you wished to refer to. You could have avoided the getElementByID by explicitly naming the form which contained the element you wished to refer to: myform.cellWhoseWidthIWantToChange.style ....
I usually assign the result of getElementById to a variable so I can use it more than once without multiple calls to the function.
HTH, Bob Barrows -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Giedrius wrote:
I would recommend using
document.getElementById('cellWhoseWidthIWantToChange').style.width 0
since it is the official standart and the code above doesn't always
work correctly.
I had to rewrite half of my intranet application (based strictly on
IE 5.5) once, because of that problem
You probably had that problem because you had a FORM tag enclosing the
elements you wished to refer to. You could have avoided the getElementByID
by explicitly naming the form which contained the element you wished to
refer to:
myform.cellWhoseWidthIWantToChange.style ....
I usually assign the result of getElementById to a variable so I can use it
more than once without multiple calls to the function.
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
I would recommend using document.getElementById('cellWhoseWidthIWantToChange').style.width 0 since it is the official standart and the code above doesn't always work correctly.
I had to rewrite half of my intranet application (based strictly on IE 5.5) once, because of that problem
You probably had that problem because you had a FORM tag enclosing the elements you wished to refer to. You could have avoided the getElementByID by explicitly naming the form which contained the element you wished to refer to: myform.cellWhoseWidthIWantToChange.style ....
I usually assign the result of getElementById to a variable so I can use it more than once without multiple calls to the function.
HTH, Bob Barrows -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Giedrius
"Bob Barrows" wrote in message news:ug#
Giedrius wrote:
> I would recommend using > document.getElementById('cellWhoseWidthIWantToChange').style.width 0 > since it is the official standart and the code above doesn't always > work correctly. > > I had to rewrite half of my intranet application (based strictly on > IE 5.5) once, because of that problem You probably had that problem because you had a FORM tag enclosing the elements you wished to refer to. You could have avoided the getElementByID by explicitly naming the form which contained the element you wished to refer to: myform.cellWhoseWidthIWantToChange.style ....
I usually assign the result of getElementById to a variable so I can use
it
more than once without multiple calls to the function.
No, actually I didn't use not even one form element in the app. Ah, nevermind...
I believe getElementById should always be used, to get the element. Of course, if you want to access the element three times of more, you should create a variable, which whould be reference to the element.
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:ug#yAnsJEHA.228@TK2MSFTNGP10.phx.gbl...
Giedrius wrote:
> I would recommend using
> document.getElementById('cellWhoseWidthIWantToChange').style.width 0
> since it is the official standart and the code above doesn't always
> work correctly.
>
> I had to rewrite half of my intranet application (based strictly on
> IE 5.5) once, because of that problem
You probably had that problem because you had a FORM tag enclosing the
elements you wished to refer to. You could have avoided the getElementByID
by explicitly naming the form which contained the element you wished to
refer to:
myform.cellWhoseWidthIWantToChange.style ....
I usually assign the result of getElementById to a variable so I can use
it
more than once without multiple calls to the function.
No, actually I didn't use not even one form element in the app. Ah,
nevermind...
I believe getElementById should always be used, to get the element.
Of course, if you want to access the element three times of more, you should
create a variable, which whould be reference to the element.
> I would recommend using > document.getElementById('cellWhoseWidthIWantToChange').style.width 0 > since it is the official standart and the code above doesn't always > work correctly. > > I had to rewrite half of my intranet application (based strictly on > IE 5.5) once, because of that problem You probably had that problem because you had a FORM tag enclosing the elements you wished to refer to. You could have avoided the getElementByID by explicitly naming the form which contained the element you wished to refer to: myform.cellWhoseWidthIWantToChange.style ....
I usually assign the result of getElementById to a variable so I can use
it
more than once without multiple calls to the function.
No, actually I didn't use not even one form element in the app. Ah, nevermind...
I believe getElementById should always be used, to get the element. Of course, if you want to access the element three times of more, you should create a variable, which whould be reference to the element.