Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 10 years ago

#7782 closed bug (invalid)

Cannot get width of table column in Chrome

Reported by: anonymous Owned by: anonymous
Priority: low Milestone: 1.next
Component: dimensions Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

Using Chrome 8, selecting a table column

<col />

and running

.width()

on it will just return 0. But using straight javascript

parseInt(el.style.width)

will get the width just fine.

This seems to work just fine in Firefox 3.6 and the IE9 beta. Chrome 8 will just return 0 for some reason.

I've put together a test case here: http://jsfiddle.net/r74JT/

Change History (7)

comment:1 Changed 13 years ago by jitter

Owner: set to anonymous
Status: newpending

And how is this a jQuery bug? If you inspect the col elements in Chrome it shows 0 as computed value. Using el.style.width just returns the css rule value.

test case with non px-value set as width.

comment:2 in reply to:  1 Changed 13 years ago by c.barr

Replying to jitter:

And how is this a jQuery bug? If you inspect the col elements in Chrome it shows 0 as computed value. Using el.style.width just returns the css rule value.

test case with non px-value set as width.

Oh sorry, I guess you're right. This is more of a Chrome bug since the computed width is incorrect. I didn't check there. Also, there was an update to Chrome 8 tonight and the problem still exists.

Although, in the same vein, shouldn't .css() return the correct value? Does that just return the style or does it return the actual computer width? I updated the example to include this as well: http://jsfiddle.net/r74JT/3/

comment:3 Changed 13 years ago by jitter

.css() returns the computed width (which in Chrome is 0px). May I suggest that you use .width() on the actual column instead of calling it on the "col" element. Or what is the use case for calling this on "col"

comment:4 Changed 13 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:5 Changed 13 years ago by jitter

Component: unfileddimensions
Milestone: 1.61.next
Priority: undecidedlow

comment:6 Changed 13 years ago by jitter

#8051 is a duplicate of this ticket.

comment:7 Changed 10 years ago by anonymous

Anyone have a way to get the computed width on col element in chrome yet??

Note: See TracTickets for help on using tickets.