0

in my yii project i have a gridview an detailview which display stretch over load screen. i have try to modified css style like this detailview

array(
    'name'=>'hal_surat',
       'htmlOptions'=>array('style'=>'max-width:200px;float:left'),
    ),

and it in gridview

array(
            'header'=>'Perihal',
             'headerHtmlOptions'=>array('style'=>'text-align:center;width:240px;max-width:240px'),
            //  'htmlOptions'=>array('style'=>'text-align:justify;max-width:240px;overflow-x: auto'),\
            'htmlOptions' => array('style' => 'white-space: nowrap;')
             'name'=>'hal_surat',
        ),

but no one solution. Any one can help me, how to make long text in gridview and detail view can fixed width adjust to width of DIV not stretch over the screen .

  • when you look at the html output, do you see your edits? If so, I suggest you check Chrome's element inspector / Firefoxes Firebug (anything that allows you to analyse the code / css) and check where the error may come from... – benomatis Mar 20 '14 at 06:00
  • and in your gridview code, you're missing a `,` (comma) at the end of the row of `htmlOptions`... – benomatis Mar 20 '14 at 06:01

1 Answers1

0

The CSS that will fix the problem for the detail view:

table.detail-view {
    table-layout: fixed;
}

table.detail-view td {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;        
}

Also you can look here:

Community
  • 1
  • 1
Radu Dumbrăveanu
  • 1,266
  • 1
  • 22
  • 32