1# GridCol 2 3The **GridCol** component must be used as a child component of the [GridRow](ts-container-gridrow.md) container. 4 5> **NOTE** 6> 7> This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version. 8 9## Child Components 10 11This component can contain only one child component. 12## APIs 13 14GridCol(option?: GridColOptions) 15 16**Widget capability**: This API can be used in ArkTS widgets since API version 9. 17 18**Atomic service API**: This API can be used in atomic services since API version 11. 19 20**Parameters** 21| Name| Type | Mandatory| Description | 22| ------ | ----------------------------------------------------- | ---- | ------------------------------------------------------------ | 23| option | [GridColOptions](#gridcoloptions) | No | Child component options of the grid layout.| 24 25## GridColOptions 26| Name| Type | Mandatory| Description | 27| ------ | ----------------------------------------------------- | ---- | ------------------------------------------------------------ | 28| span | number \| [GridColColumnOption](#gridcolcolumnoption) | No | Number of columns occupied by the component. If it is set to **0**, the component is not involved in layout calculation, that is, the component is not rendered.<br>Default value: **1**| 29| offset | number \| [GridColColumnOption](#gridcolcolumnoption) | No | Number of offset columns relative to the original position of the component.<br>Default value: **0** | 30| order | number \| [GridColColumnOption](#gridcolcolumnoption) | No | Sequence number of the component. Child components of the grid are sorted in ascending order based on their sequence numbers.<br>Default value: **0**<br>**NOTE**<br>If a child component shares an **order** value with another child component or does not have **order** set, it is displayed based on its code sequence number.<br>If **order** is not set for all child components, those that have **order** set are displayed after those that do not and are sorted in ascending order based on the value.| 31 32The values of `span`, `offset`, and `order` attributes are inherited in the sequence of **xs**, **sm**, **md**, **lg**, **xl**, and **xxl**. If no value is set for a breakpoint, the value is obtained from the previous breakpoint. 33 34## Attributes 35In addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported. 36 37### span 38 39span(value: number | GridColColumnOption) 40 41Sets the number of columns occupied by the component. If it is set to **0**, the element is not involved in layout calculation, that is, the element is not rendered. 42 43**Widget capability**: This API can be used in ArkTS widgets since API version 9. 44 45**Atomic service API**: This API can be used in atomic services since API version 11. 46 47**System capability**: SystemCapability.ArkUI.ArkUI.Full 48 49**Parameters** 50 51| Name| Type | Mandatory| Description | 52| ------ | ------------------------------------------------------------ | ---- | ------------------------ | 53| value | number \| [GridColColumnOption](#gridcolcolumnoption) | Yes | Number of occupied columns.<br>Default value: **1**| 54 55### gridColOffset 56 57gridColOffset(value: number | GridColColumnOption) 58 59Sets the number of offset columns relative to the original position of the component. 60 61**Widget capability**: This API can be used in ArkTS widgets since API version 9. 62 63**Atomic service API**: This API can be used in atomic services since API version 11. 64 65**System capability**: SystemCapability.ArkUI.ArkUI.Full 66 67**Parameters** 68 69| Name| Type | Mandatory| Description | 70| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------ | 71| value | number \| [GridColColumnOption](#gridcolcolumnoption) | Yes | Number of offset columns relative to the previous child component of the grid<br>Default value: **0**| 72 73### order 74 75order(value: number | GridColColumnOption) 76 77Sets the sequence number of the component. Child components of the grid are sorted in ascending order based on their sequence numbers. 78 79**Widget capability**: This API can be used in ArkTS widgets since API version 9. 80 81**Atomic service API**: This API can be used in atomic services since API version 11. 82 83**System capability**: SystemCapability.ArkUI.ArkUI.Full 84 85**Parameters** 86 87| Name| Type | Mandatory| Description | 88| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 89| value | number \| [GridColColumnOption](#gridcolcolumnoption) | Yes | Sequence number of the component. Child components of the grid are sorted in ascending order based on their sequence numbers.<br>Default value: **0**| 90 91## GridColColumnOption 92 93Describes the numbers of grid columns occupied by the **GridCol** component on devices with different width types. 94 95**Widget capability**: This API can be used in ArkTS widgets since API version 9. 96 97**Atomic service API**: This API can be used in atomic services since API version 11. 98 99| Name | Type | Mandatory | Description | 100| ----- | ------ | ---- | ---------------------------------------- | 101| xs | number | No | Number of grid columns on the device where the grid size is xs. | 102| sm | number | No | Number of grid columns on the device where the grid size is sm. | 103| md | number | No | Number of grid columns on the device where the grid size is md. | 104| lg | number | No | Number of grid columns on the device where the grid size is lg. | 105| xl | number | No | Number of grid columns on the device where the grid size is xl. | 106| xxl | number | No | Number of grid columns on the device where the grid size is xxl. | 107 108## Example 109See [GridRow](ts-container-gridrow.md#example). 110