"px" is only for css and not for direct html attributes. Take that away and it should work.

Yeah, you're right about that. But this works for me both ways.. not sure why. I tried it as 'htmlOptions'=>array('style'=>'width:80px') and that works.. but I think an even better way to do it would be just to add it to the header column and not every column via 'headerHtmlOptions'. This is sort of the quick and dirty way of doing things.

I did this other technique yesterday day by specifying a special css file for the CGridView. I'm not sure if I have the best way of doing this, because when I first did it I lost all styling, so I made a copy of the CGridView style.css file in my project css directory and then referenced the column header id with a specific width.

Can you see the changes coming through if you inspect with firebug? If you use the htmlOptions thing, you should see something like <th style="width:80px"> or if you went the css file, you would see it in the style area of firebug.. whatever you're using, does it show up upon inspection?

Can you see the changes coming through if you inspect with firebug? If you use the htmlOptions thing, you should see something like <th style="width:80px"> or if you went the css file, you would see it in the style area of firebug.. whatever you're using, does it show up upon inspection?

Nope, no changes at all (inspected with Firebug)

Can't find out why

[edit]
I see changes, I had commented it temporarily.

But table does not move an inch

[edit]
I noticed the GridView goes under the default borders - this is the reason why it ignores width. But I believe it still should listen to params, as other grids need to be smaller.

With my own (simple) grid I ended up with a row of <col> tags for better control of width and alignment. (Can't recall the reason it didn't work well with <th>, perhaps the left/right alignment or need for fixed column width.)

Is there a way to add a url to an image type column, or have an image with a link in any of the other types of columns?.. I can not for the life of me figure out how to display an image in a column in CGridview and have it link somewhere..

Is there a way to add a url to an image type column, or have an image with a link in any of the other types of columns?.. I can not for the life of me figure out how to display an image in a column in CGridview and have it link somewhere..

I also was trying to control button column widths etc via CSS and found I also had similar troubles to the above posts. I found out a few things that stopped my custom CSS from working.

1/ make sure your path is correct in the cssFile parameter!! (as mentioned in previous posts!)

2/ Multiple cgridviews in the same view - I found I had to set ALL cgridviews to my custom CSS otherwise I would get the situation that the default styles.css would be loaded as well as my custom CSS (ie. 'gridview.css') but styles.css would take precedence over my custom gridview.css and thus would never show my changed style.