# Columns and Rows Dimensions

The TileLayout is based on the [CSS Grid Layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout) and is configurable in a similar fashion.

To define the number of visual columns in the component, use the [`columns`](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutcomponent#columns) property. By default, the component will display a single column. The number of rows will be calculated automatically based on the number of tiles and their size.

```html
    <kendo-tilelayout [columns]="2"></kendo-tilelayout>
```

## Size

You can customize the width of the columns and the height of the rows by using the [`columnWidth`](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutcomponent#columnwidth) and [`rowHeight`](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutcomponent#rowheight) options. By default, both properties are set to `1fr` which means that the size of each column and row will be determined automatically based on the available space.

> Depending on the value of the `columnWidth` property, the total width of all columns may exceed the available space. In such cases, some items will overflow the TileLayout container.

The following example demonstrates how to customize the size of the TileLayout columns and rows.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/layout/tilelayout/basic/size/source.txt)

## Spacing

By default, the spacing between the columns and the rows is set to `16px`. It can be customized by setting the [`gap`](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutcomponent#gap) configuration option which accepts either numeric values, which are treated as pixels, or a [`TileLayoutGap`](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutgap) configuration object with the following keys:

* `rows`(number)—Sets the vertical spacing between the rows in pixels.
* `cols`(number)—Sets the horizontal spacing between the columns in pixels.

The following example demonstrates how to set the horizontal and vertical gaps.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/layout/tilelayout/basic/gaps/source.txt)

## Suggested Links

* [Tiles Configuration](https://www.telerik.com/kendo-angular-ui-develop/components/layout/tilelayout/tiles-configuration)
* [Tiles Reordering](https://www.telerik.com/kendo-angular-ui-develop/components/layout/tilelayout/reordering)
* [Tiles Resizing](https://www.telerik.com/kendo-angular-ui-develop/components/layout/tilelayout/resizing)
* [API Reference of the TileLayoutComponent](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutcomponent)
* [API Reference of the TileLayoutItemComponent](https://www.telerik.com/kendo-angular-ui-develop/components/layout/api/tilelayoutitemcomponent)
