|  | Setting table column width? |  | |
| | | Tim Ward |  |
| Posted: Mon Sep 15, 2008 10:16 am Post subject: Setting table column width? |  |
Where col is a <col> element:
col.style.width = "27px";
works fine on Firefox but not on IE. How do you set a column width in IE? (If it matters, the <col> is not one that was present in HTML, it was created in the Javascript.)
-- Tim Ward LINK |
| |
| | | Martin Honnen |  |
| Posted: Mon Sep 15, 2008 10:35 am Post subject: Re: Setting table column width? |  |
Tim Ward wrote:
| Quote: | Where col is a <col> element:
col.style.width = "27px";
works fine on Firefox but not on IE. How do you set a column width in IE?
|
col.width = "27" should work with Firefox, IE and other browsers.
--
Martin Honnen http://JavaScript.FAQTs.com/ |
| |
| | | Tim Ward |  |
| Posted: Mon Sep 15, 2008 12:55 pm Post subject: Re: Setting table column width? |  |
"Martin Honnen" <mahotrash@yahoo.de> wrote in message news:48ce5691$0$18736$9b4e6d93@newsspool1.arcor-online.net...
| Quote: | Tim Ward wrote: Where col is a <col> element:
col.style.width = "27px";
works fine on Firefox but not on IE. How do you set a column width in IE?
col.width = "27" should work with Firefox, IE and other browsers.
|
Like all the other things I've tried, it works with Firefox and not IE.
-- Tim Ward LINK |
| |
| | | Thomas 'PointedEars' Lahn |  |
| Posted: Mon Sep 15, 2008 4:03 pm Post subject: Re: Setting table column width? |  |
Tim Ward wrote:
| Quote: | "Martin Honnen" <mahotrash@yahoo.de> wrote [...]: Tim Ward wrote: Where col is a <col> element:
col.style.width = "27px";
works fine on Firefox but not on IE. How do you set a column width in IE? col.width = "27" should work with Firefox, IE and other browsers.
Like all the other things I've tried, it works with Firefox and not IE.
|
AFAIK, MSHTML does not support the `col' element for formatting table columns due to its non-standard box model.
However, "Does not work" is a useless error description. [psf 4.11]
PointedEars -- Prototype.js was written by people who don't know javascript for people who don't know javascript. People who don't know javascript are not the best source of advice on designing systems that use javascript. -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk> |
| |
| | | Tim Ward |  |
| Posted: Tue Sep 16, 2008 8:47 am Post subject: Re: Setting table column width? |  |
"Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote in message news:48CEA369.7070803@PointedEars.de...
| Quote: | AFAIK, MSHTML does not support the `col' element for formatting table columns due to its non-standard box model.
|
Yeah, I've given up on using <table> and am setting out a table using <div> and <span>, then changing column widths by scripting the style sheet. That works.
-- Tim Ward LINK |
| |
| | | Thomas 'PointedEars' Lahn |  |
| Posted: Tue Sep 16, 2008 11:30 am Post subject: Re: Setting table column width? |  |
Tim Ward wrote:
| Quote: | "Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote [...]: AFAIK, MSHTML does not support the `col' element for formatting table columns due to its non-standard box model.
Yeah, I've given up on using <table> and am setting out a table using <div and <span>, then changing column widths by scripting the style sheet. That works.
|
It is the wrong approach, though, unless you do not have tabular data there.
PointedEars -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann |
| |
| | | Laser Lips |  |
| Posted: Tue Sep 16, 2008 2:43 pm Post subject: Re: Setting table column width? |  |
On Sep 16, 2:30 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de> wrote:
| Quote: | Tim Ward wrote: "Thomas 'PointedEars' Lahn" <PointedE...@web.de> wrote [...]: AFAIK, MSHTML does not support the `col' element for formatting table columns due to its non-standard box model.
Yeah, I've given up on using <table> and am setting out a table using <div and <span>, then changing column widths by scripting the style sheet. That works.
It is the wrong approach, though, unless you do not have tabular data there.
PointedEars -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann
|
Try using col.offsetWidth=27; |
| |
| | | Conrad Lender |  |
| Posted: Tue Sep 16, 2008 5:13 pm Post subject: Re: Setting table column width? |  |
On 2008-09-16 16:43, Laser Lips wrote:
| Quote: | Try using col.offsetWidth=27;
|
Try it yourself, and tell us if it worked. Hint: offsetWidth is a readonly property.
- Conrad |
| |
|
|