Closed GerdHoeren closed 5 months ago
Looks like the height is incorrect for new documents as well (it's 20 which is the height of one row).
Calculation fixed (and for width too). v4.11.2 is latest.
Thank you for the quick update. The table.height field now updates, but it appears that it does not take into account the cell borders. I would expect the following code to create table1 100 pixels below table0:
y = table0.height + 100.0
table1 = spreadsheet.sheets[tab].add_table("Virtual " + tab, 0, y, 2, 4)
Notice in this image table1 overlaps the bottom of table0:
If I change the code to: y = table0.height *+ numRows2** + 100.0 table1 = spreadsheet.sheets[tab].add_table("Virtual " + tab, 0, y, 2, 4)
Table1 is created where I would expect:
Row heights and columns widths now include borders. I'm matching the sizes reported in Numbers in my testing so 0.35pt is the default which appears not to affect overall table height/width.
Thank you for fixing this issue. "table.height" now works as expected.
Describe the bug I'm creating two tables on a sheet. A variable number of rows gets added to the first table. I'd like the table.height property to reflect the updated height after adding the rows, so that I can use it to correctly position the second table below it.
To Reproduce def WriteTableData(dict, table):
Append rows to the end of this table
def bug(): table0 = [ ... ] # First table in sheet
Output is: Before insert: table0.height 36 Rows added 110 After insert: table0.height 36
Expected behavior table0.height should increase to account for the 110 rows that have been added.
Attachments If you can, upload the Numbers spreadsheet or a simple reproducer that triggers the bug.
Additional information python -m pip list [ ... ] numbers-parser 4.10.5
Add any other context about the problem here. I'm working around this issue by calculating the Y position of table 1 with:
Create table 1
But, this doesn't work if added rows contain text that wraps and expands the row height.