This is a migrated thread and some comments may be shown as answers.

Grid Width

3 Answers 3369 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Werit
Top achievements
Rank 1
Werit asked on 03 Feb 2012, 04:27 PM
How do I tell a grid (k-grid) not to use a 100% width? 

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 06 Feb 2012, 09:37 AM
Hello Werit,

You can set the width of HTML element.
<div id="grid" style="width:800px;"></div>

Alternatively it is possible to use a CSS rule.
.k-grid {
    width: 80%;
}


All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Zachary
Top achievements
Rank 1
answered on 30 Aug 2013, 06:03 AM
I came here trying to configure the grid width to auto, so it is only as wide as its content.

Being a standard HTML table, you can set .k-grid > table to auto via CSS. The only problem with this approach is that the wrapper div (with its border) stays at 100% width.

The only way I found to accomplish the goal was using a float on the wrapper div.

<div id="grid" style="float: left"></div>
0
Dimo
Telerik team
answered on 30 Aug 2013, 10:40 AM
Hello Zachary,

Depending on the exact elements surrounding the Grid, you can alternatively use an inline-block display for its outer <div>.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Werit
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Zachary
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or