Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skipRow() skips two lines instead of one #101

Open
CristinCebotari opened this issue Feb 24, 2025 · 0 comments
Open

skipRow() skips two lines instead of one #101

CristinCebotari opened this issue Feb 24, 2025 · 0 comments

Comments

@CristinCebotari
Copy link

In version v6.4.1, the skipRow() function skips two lines instead of one. This didn't happen in version 5.8.1.
Here's the code example:

$excel = Excel::create(['Sheet1']);
$sheet = $excel->sheet();

// Write heads
$sheet->writeRow(['Date', 'Name', 'Amount']);

// Write rows
$sheet->writeRow(['2003-12-31', 'James', '220']);
$sheet->skipRow();
$sheet->writeRow(['2003-8-23', 'Mike', '153.5']);

$excel->save('simple.xlsx');

Output:

Image

POSSIBLE SOLUTION:

for ($i = 0; $i <= $rowCount; $i++) {

...
for ($i = 1; $i <= $rowCount; $i++) {
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant