mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-01 04:59:14 +00:00
Fix for single row/column tables... though very weird to create manually in MS Excel, because creating a single row table always creates a two row table (1 row headers and 1 row data). But subsequently hiding the header row; and then deleting that row will create such a table.
This commit is contained in:
@@ -298,8 +298,8 @@ class Table
|
||||
}
|
||||
|
||||
[$width, $height] = Coordinate::rangeDimension($range);
|
||||
if ($width < 1 || $height < 2) {
|
||||
throw new PhpSpreadsheetException('The table range must be at least 1 column and 2 rows');
|
||||
if ($width < 1 || $height < 1) {
|
||||
throw new PhpSpreadsheetException('The table range must be at least 1 column and row');
|
||||
}
|
||||
|
||||
$this->range = $range;
|
||||
|
||||
@@ -15,6 +15,6 @@ class Issue3277Test extends TestCase
|
||||
|
||||
$array = $spreadsheet->getActiveSheet()->toArray();
|
||||
|
||||
$this->assertSame('data', $array[0][0]);
|
||||
self::assertSame('data', $array[0][0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,9 +207,8 @@ class TableTest extends SetupTeardown
|
||||
{
|
||||
return [
|
||||
['A1'],
|
||||
['A1:A1'],
|
||||
['B1:A4'],
|
||||
['A1:D1'],
|
||||
['B12:B4'],
|
||||
['D1:A1'],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user