在YII应用程序中更改CSS文件不起作用

I am trying to change the styling of the gridview, tableview, & detailview. I found something saying that I should change the config/main.php file to this:

...
// application components
'components'=>array(
    'user'=>array(
        // enable cookie-based authentication
        'allowAutoLogin'=>true,
    ),
    'bootstrap'=>array(
        'class'=>'bootstrap.components.Bootstrap',
    ),
     'widgetFactory'=>array(
        'widgets'=>array(
            'CGridView'=>array(
                'cssFile' => Yii::app()->request->baseUrl.'/css/table_and_grid.css',
            ),

        ),
    ),
...

I have removed the assets folder that is generated by the app, but that didn't help. When I load the view, I can see that the css sheet is being loaded into the header of the page, but none of the styling is working. Why? How do I fix?

I haven't seen anything about changing the style of CGridView in main config file(main.php), But you can customize CGridView styles with bellow parameters:

$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'SOME ID',
'dataProvider'=>$YOUR_DATA_PROVIDET,
'cssFile'=>'...',
'baseScriptUrl'=>'...',
'filterCssClass'=>'...',
'itemsCssClass'=>'...',
'pagerCssClass'=>'...',
'rowCssClass'=>'...',
'summaryCssClass'=>'...',
));

You can change ... with your own. for more information you can check CGridView's Official document on the following link:

CGridView