473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Setting table column width?

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
7 3129
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
"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
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
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Laura | last post by:
Hello, Newbie question: Does anyone know how to dynamically set the screen width in an applet? I have an applet that creates a horizontal bar menu on a webpage, and I would like the width to be...
4
by: Alex Meier | last post by:
I have the following problem: I need a simple, tabular layout in a webshop. - left column: navigation column with approx. 170px width - right column: content area the goal: the left column...
2
by: Dan Cook | last post by:
Ok... here's the scoop... I've got an unbound form with Serial Number, Building, and Room... all this is in tableA... Now I've got the form setup with building, room and serial number as combo...
2
by: Tim Nelson | last post by:
I thought there should be simple way of setting the column width in the a DataGrid. I've set up a table style (properties tab) that lengthen the columns, but I can't seem to bind this table style...
0
by: Reza Nabi | last post by:
Dear All: Banckgroud: I have a datagrid which lives inside a repeater. Which is working fine. What i need is to dyanamically set the column width of the grid (which lieves inside the repeater)....
4
by: Rich | last post by:
Hello, I have a one datagrid that will be based on different datatables. One datatable may have 7 columns, another 15... With the tables that have more columns, I have been manually dragging...
2
by: saxm-un | last post by:
Hi, I'm just beginning CSS based web development and although I've been bashing away at it since yesterday, I'm still stuck with positioning things on pages. I'm trying to make (in table-speak)...
2
by: Charleees | last post by:
Hi all, I have a DataGrid with Template Columns..... There are LAbels,Linkbuttons in the Single Row.. I have to set the Constant Column width for those Template Columns in Grid... Wat...
4
by: Chuck | last post by:
I'm setting the column with for a gridview (25+- columns) and have paging turned on. When the gridview is first displayed, the column widths are all set to the default. But after paging to...
2
by: Jacksm | last post by:
How can I align an asp:table columns with gridview columns (the widths)? I have tried setting table.column(0).width = gridview.column(0).width at page_load but it doesn't work. Thanks in advance
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.