How can I set the size of a table using TPPDF? By default, the table width seems to cover the whole page, and I'm not sure how to change that. I need my table cells to be square, but can only control their width relative to that of the table. Alternatively, is there another PDF generation Cocoapod that would allow me to have more control of the cell dimensions?
Asked
Active
Viewed 79 times
1
-
This is vague - you should elaborate if you want a better answer. – Michael Nelles Jan 31 '20 at 16:13
-
What more information is needed? I'm trying to create a table that outputs to a PDF and I need the cells to be square. I'm using the TPPDF cocoapod, which doesn't seem to let you control the overall size of the table or the height of the cell, only the percentage width of the cells. I need to have more control over the size of the cells. Is this possible with TPPDF qnd if not, what is a good alternative method for producing tables in PDFs from an iOS app? – KBurke Feb 01 '20 at 18:47
1 Answers
0
I am the creator of TPPDF. Sorry I didn't see your question earlier.
You are right, tables currently do not support any static dimensions, as they are calculated dynamically. Please check if there is an open issue about this, otherwise open up another one (please provide a code example).
As for now, there are multiple approaches for your case:
- Set the column widths to a desired relative width, it must not be 100% width in sum.
- Set the indentation left and/or right, so the width of the table reduces
- Try a different document structure such as
sections
orgroups

Phil Niedertscheider
- 1,068
- 11
- 29