kartik-v / yii2-grid

Enhanced GridView with various utilities for Yii Framework 2.0
http://demos.krajee.com/grid
Other
556 stars 303 forks source link

Horizontal scrollbar overflow #967

Closed ecmciasabellano closed 4 years ago

ecmciasabellano commented 4 years ago

Need help on enabling overflow on GridView.

Here is the screenshot of my GridView, I want the table to have a horizontal scrollbar but it is not working.

I tried to use headerOptions on each column but still the columns did not overflow.

image

ecmciasabellano commented 4 years ago

I tried to have many columns and the table overflows.

But on my screenshot, I want to be able to have a long width for specific columns that will make the table overflow.

Specifying the width on headerOptions does not work, it only adjusts all of the columns.

kartik-v commented 4 years ago

This is more a CSS styling issue to handle. One way is you can set the responsive property to true for the GridView. This will use the bootstrap CSS framework responsive horizontal scrolling for tables

ecmciasabellano commented 4 years ago

I just found a way to do that.

Use contentOptions on a specific column and add a style white-space: nowrap

Thanks.

kartik-v commented 4 years ago

Great. You can also do that in an easier way within kartik\grid\DataColumn settings by setting a special property noWrap to true