# Grid

Grid is a new container view that arranges views in a two-dimensional grid.&#x20;

Grid will measure its subviews up front to enable cells that span multiple columns and enable automatic alignments across rows and columns.

This particular grid view contains two GridRow instances.\
Within a row, each view corresponds to a column.<br>

🔥 In `contentView` add a second tab&#x20;

// Create a Grid View

**import** Charts

**import** SwiftUI

<br>

**struct** ContentView: View {

&#x20;   @State **private** **var** selection = 2

&#x20;  &#x20;

&#x20;   **var** body: **some** View {

&#x20;       TabView(selection: $selection) {

&#x20;           WinesTab()

&#x20;               .tabItem {

&#x20;                   Label("Wines", systemImage: "chart.bar.doc.horizontal")

&#x20;               }

&#x20;               .tag(1)

&#x20;           <mark style="color:orange;">Grid {</mark>

&#x20;               <mark style="color:orange;">GridRow {</mark>

&#x20;                   <mark style="color:orange;">ParisDetailsChart()</mark>

&#x20;                       <mark style="color:orange;">.gridCellColumns(2)</mark>

&#x20;               <mark style="color:orange;">}</mark>

&#x20;               <mark style="color:orange;">GridRow {</mark>

&#x20;                   <mark style="color:orange;">AmsterdamDetailsChart()</mark>

&#x20;                   <mark style="color:orange;">SalesDetailsChart()</mark>

&#x20;               <mark style="color:orange;">}</mark>

&#x20;           <mark style="color:orange;">}</mark>

&#x20;               <mark style="color:orange;">.tabItem {</mark>

&#x20;                   <mark style="color:orange;">Label("Overview", systemImage: "square.grid.2x2")</mark>

&#x20;               <mark style="color:orange;">}</mark>

&#x20;               <mark style="color:orange;">.tag(2)</mark>

&#x20;       }

&#x20;   }

}

<br>

**struct** ContentView\_Previews: PreviewProvider {

&#x20;   **static** **var** previews: **some** View {

&#x20;       ContentView()

&#x20;   }

}

```swift
// Example

struct WeatherDetailView: View {
    var body: some View {
        Grid {
            GridRow {
                NameHeadLine()
                    .gridCellColumns(2)
            }
            GridRow {
                CalendarIcon()
                SymbolGrid()
            }
        }
    }
}
```
