I have been trying to avoid the HtmlAttributes because I feel like it could add too much to the markup. I much prefer adding a css class to a parent element and using the stylesheet to drill down to individual elements if necessary.
The following approach (edited for brevity) is working quite well so far:
CSS:
.k-widget.k-grid-sm {
font-size: 0.8rem;
}
.k-grid.k-grid-sm .k-button {
font-size: 0.8rem;
}
.k-grid.k-grid-sm td {
padding: 0.4rem;
}
.k-grid.k-grid-sm th {
padding: 0.4rem;
}
.k-grid.k-grid-sm .k-command-cell > .k-button {
margin-top: 0;
margin-bottom: 0;
}
JS:
function myGrid_DataBound(e) {
$(this.element[0]).addClass('k-grid-sm');
}
Grid:
<div id="exampleGrid"></div>
<script>
kendo.syncReady(function(){
jQuery("#exampleGrid").kendoGrid({
"dataBound":myGrid_DataBound
...
});
});
</script>
(hope this is clear - I don't know how to format code in this forum, sorry!)