Side navigation
#7782 closed bug (invalid)
Opened December 14, 2010 09:30PM UTC
Closed December 30, 2010 07:47AM UTC
Last modified July 10, 2013 06:52AM UTC
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/
Attachments (0)
Change History (7)
Changed December 14, 2010 11:49PM UTC by comment:1
owner: | → anonymous |
---|---|
status: | new → pending |
Changed December 15, 2010 03:56AM UTC by comment:2
Replying to [comment:1 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/
Changed December 15, 2010 07:54PM UTC by comment:3
.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"
Changed December 30, 2010 07:47AM UTC by comment:4
resolution: | → invalid |
---|---|
status: | pending → closed |
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!
Changed January 25, 2011 07:00PM UTC by comment:5
component: | unfiled → dimensions |
---|---|
milestone: | 1.6 → 1.next |
priority: | undecided → low |
Changed July 10, 2013 06:52AM UTC by comment:7
Anyone have a way to get the computed width on col element in chrome yet??
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.