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

Compact angular grids

2 Answers 1147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 09 Jan 2018, 05:36 AM

I'm trying to create more condensed grids in Kendo UI for Angular.

I've added a style to reduce the font size which works

k-grid {font-size:10px;}

However try and change the default padding from  padding: 8px 12px; to nothing it seems to have no effect.

k-grid td {padding:0px;}

I've taken the demo grid from the Kendo Angular site and just added these styles to https://plnkr.co/edit/WByOCE8JzmJkNq4wROIw?p=preview

Any ideas on how to compact the grid to fit more data in?

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 09 Jan 2018, 06:33 AM
Hello Neil,

To set the same rule for multiple selectors, you will need to list the selectors, separated by commas, and then provide the rule. Furthermore, a dot (".") was missing in front of the k-grid class in the second selector. To overwrite CSS of inner components you will also need to use any of the special "deep" combinators, or set the ViewEncapsulation to "None", e.g.:

styles: [`
      >>> .k-grid, >>> .k-grid .k-button {font-size:10px;}
      >>> .k-grid td, >>> .k-grid th {padding:0;}
    `],

https://plnkr.co/edit/Lpx7MCuzZACfx5WxgAXK?p=preview

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Neil
Top achievements
Rank 1
answered on 09 Jan 2018, 10:29 AM
Thanks. That works great :-)
Tags
General Discussions
Asked by
Neil
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Neil
Top achievements
Rank 1
Share this question
or