You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Google Spreadsheet API does not allow you to update a list row if headers are not already assigned. So, when you create a new worksheet, before you can add data to a worksheet using the 'Adding/Updating a list row' methods above, you need to add headers.
142
+
143
+
To add headers to a worksheet, use the following:
144
+
```php
145
+
$cellFeed = $worksheet->getCellFeed();
146
+
147
+
$cellFeed->editCell(1,1, "Row1Col1Header");
148
+
$cellFeed->editCell(1,2, "Row1Col2Header");
149
+
```
150
+
126
151
The only required parameter is the worksheet name, The row and column count are optional. The default value for rows is 100 and columns is 10.
127
152
128
153
## Deleting a worksheet
@@ -133,7 +158,7 @@ It's also possible to delete a worksheet.
133
158
$worksheet->delete();
134
159
```
135
160
136
-
## Working with list-based feeds
161
+
## Working with list feeds
137
162
138
163
List feeds work at the row level. Each entry will contain the data for a specific row.
139
164
@@ -209,18 +234,6 @@ You can then update the cell value using the 'update' method. The value can be a
209
234
$cell->update("=SUM(B2:B9)");
210
235
```
211
236
212
-
### Adding headers to a new worksheet
213
-
214
-
The Google Spreadsheet API does not allow you to update a list row if headers are not already assigned. So, when you create a new worksheet, before you can add data to a worksheet using the 'Adding/Updating a list row' methods above, you need to add headers.
215
-
216
-
To add headers to a worksheet, use the following:
217
-
```php
218
-
$cellFeed = $worksheet->getCellFeed();
219
-
220
-
$cellFeed->editCell(1,1, "Row1Col1Header");
221
-
$cellFeed->editCell(1,2, "Row1Col2Header");
222
-
```
223
-
224
237
### Updating multiple cells with a batch request
225
238
226
239
When attempting to insert data into multiple cells then consider using the batch request functionality to improve performance.
0 commit comments