MCPcopy
hub / github.com/TanStack/table / App

Function App

examples/solid/column-groups/src/App.tsx:97–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95]
96
97function App() {
98 const [data, setData] = createSignal(defaultData)
99 const rerender = () => setData(defaultData)
100
101 const table = createSolidTable({
102 get data() {
103 return data()
104 },
105 columns: defaultColumns,
106 getCoreRowModel: getCoreRowModel(),
107 })
108
109 return (
110 <div class="p-2">
111 <table>
112 <thead>
113 <For each={table.getHeaderGroups()}>
114 {headerGroup => (
115 <tr>
116 <For each={headerGroup.headers}>
117 {header => (
118 <th colSpan={header.colSpan}>
119 {header.isPlaceholder
120 ? null
121 : flexRender(
122 header.column.columnDef.header,
123 header.getContext()
124 )}
125 </th>
126 )}
127 </For>
128 </tr>
129 )}
130 </For>
131 </thead>
132 <tbody>
133 <For each={table.getRowModel().rows}>
134 {row => (
135 <tr>
136 <For each={row.getVisibleCells()}>
137 {cell => (
138 <td>
139 {flexRender(
140 cell.column.columnDef.cell,
141 cell.getContext()
142 )}
143 </td>
144 )}
145 </For>
146 </tr>
147 )}
148 </For>
149 </tbody>
150 <tfoot>
151 <For each={table.getFooterGroups()}>
152 {footerGroup => (
153 <tr>
154 <For each={footerGroup.headers}>

Callers

nothing calls this directly

Calls 5

createSolidTableFunction · 0.90
flexRenderFunction · 0.90
getCoreRowModelFunction · 0.85
getContextMethod · 0.80
rerenderFunction · 0.70

Tested by

no test coverage detected