By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,638 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

Setting table column width?

P: n/a
Where col is a <colelement:

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 <colis not one that was present in HTML, it was
created in the Javascript.)

--
Tim Ward
www.brettward.co.uk
Sep 15 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Tim Ward wrote:
Where col is a <colelement:

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/
Sep 15 '08 #2

P: n/a
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:48***********************@newsspool1.arcor-online.net...
Tim Ward wrote:
>Where col is a <colelement:

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
www.brettward.co.uk
Sep 15 '08 #3

P: n/a
Tim Ward wrote:
"Martin Honnen" <ma*******@yahoo.dewrote [...]:
>Tim Ward wrote:
>>Where col is a <colelement:

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, <f8*******************@news.demon.co.uk>
Sep 15 '08 #4

P: n/a
"Thomas 'PointedEars' Lahn" <Po*********@web.dewrote in message
news:48**************@PointedEars.de...
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 <tableand am setting out a table using <div>
and <span>, then changing column widths by scripting the style sheet. That
works.

--
Tim Ward
www.brettward.co.uk
Sep 16 '08 #5

P: n/a
Tim Ward wrote:
"Thomas 'PointedEars' Lahn" <Po*********@web.dewrote [...]:
>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 <tableand 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
Sep 16 '08 #6

P: n/a
On Sep 16, 2:30*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Tim Ward wrote:
"Thomas 'PointedEars' Lahn" <PointedE...@web.dewrote [...]:
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 <tableand 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;
Sep 16 '08 #7

P: n/a
On 2008-09-16 16:43, Laser Lips wrote:
Try using col.offsetWidth=27;
Try it yourself, and tell us if it worked.
Hint: offsetWidth is a readonly property.
- Conrad
Sep 16 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.