Skip to content

Commit 95e32e2

Browse files
committed
Updated README
1 parent 923cd28 commit 95e32e2

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
* [Installation](#installation)
88
* [Bootstrapping](#bootstrapping)
99
* [Retrieving a list of spreadsheets](#retrieving-a-list-of-spreadsheets)
10+
* [Retrieving a public spreadsheet](#retrieving-a-public-spreadsheet)
11+
* [Retrieving a list of worksheets](#retrieving-a-list-of-worksheets)
12+
* [Adding a worksheet](#adding-a-worksheet)
13+
* [Adding headers to anew worksheet](#adding-headers-to-a-new-worksheet)
14+
* [Deleting a worksheet](#deleting-a-worksheet)
15+
* [List feed](#working-with-list-feeds)
16+
* [Retrieving a list feed](#retrieving-a-list-feed)
17+
* [Adding a list row](#adding-a-list-row)
18+
* [Updating a list row](#updating-a-list-row)
19+
* [Cell feed](#working-with-cell-based-feeds)
20+
* [Retrieving a cell feed](#retrieving-a-cell-feed)
21+
* [Updating a cell](#updating-a-cell)
22+
* [Batch request](#updating-multiple-cells-with-a-batch-request)
1023

1124
# Introduction
1225

@@ -123,6 +136,18 @@ To create a new worksheet simply use the 'addWorksheet()' method. This takes 3 a
123136
$spreadsheet->addWorksheet('New Worksheet', 50, 20);
124137
```
125138

139+
### Adding headers to a new worksheet
140+
141+
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+
126151
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.
127152

128153
## Deleting a worksheet
@@ -133,7 +158,7 @@ It's also possible to delete a worksheet.
133158
$worksheet->delete();
134159
```
135160

136-
## Working with list-based feeds
161+
## Working with list feeds
137162

138163
List feeds work at the row level. Each entry will contain the data for a specific row.
139164

@@ -209,18 +234,6 @@ You can then update the cell value using the 'update' method. The value can be a
209234
$cell->update("=SUM(B2:B9)");
210235
```
211236

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-
224237
### Updating multiple cells with a batch request
225238

226239
When attempting to insert data into multiple cells then consider using the batch request functionality to improve performance.

0 commit comments

Comments
 (0)