473,756 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3147
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*******@yaho o.dewrote in message
news:48******** *************** @newsspool1.arc or-online.net...
Tim Ward wrote:
>Where col is a <colelement:

col.style.widt h = "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*******@yaho o.dewrote [...]:
>Tim Ward wrote:
>>Where col is a <colelement:

col.style.wid th = "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.de mon.co.uk>
Sep 15 '08 #4
"Thomas 'PointedEars' Lahn" <Po*********@we b.dewrote in message
news:48******** ******@PointedE ars.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*********@we b.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...@we b.de>
wrote:
Tim Ward wrote:
"Thomas 'PointedEars' Lahn" <PointedE...@we b.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
8307
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 100%. Unfortunately, this doesn't work with Explorer. so, in my html page, I wrote a function like this: <SCRIPT LANGUAGE="JavaScript"> int function getScreenWidth()
4
6153
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 should contain a few "boxes" (these are HTML- tables) which should be all of the same width. So, I attributed the left column with 'width="170"' and assigned the attribute 'width="100%"' to all contained <table>s. This should
2
1560
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 fields... I've got it so that when you click the dropdown on Building it queries the table for all buildings, then the one for room queries for all the rooms in the picked building, and the serial number drop down queries on building or building...
2
1685
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 to the grid (or it's columns I guess). No matter what I do the grid keeps a standard column size for each column. Can anyone throw me a bone here? Thanks.
0
1836
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). Is there any way, we accomplish this? Any advice on this would be greatly appreciated. Reza. ---BEGIN PART Of ListApp.aspx --->
4
4193
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 column widths to narrow them. I want to record these widths so I can reapply them when I bind the datagrid to the table with 15 columns. I have searched around for articles on this and saw some that talked about...
2
1493
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) two (or possibly more later) rows each of three columns, with a table width 60% of the width of the screen with a 10% left hand margin. I've been bashing away at the CSS for a while now, and I'm almost there (except I can't get the top-edge of...
2
10405
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 actually happens is... when the Text size is too big... the column
4
15427
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 another page, the widths are set as they should be. Going back to page one, the widths are still correct. Not a clue what's going on here!
2
11722
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
9255
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10014
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9844
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9689
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8688
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7226
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.