There's a lot of things that I like about the way that tables are setup. Among them the idea I can assign contents to a table and have them fill to the correct cell as long as the data is formatted correctly.
However two things irk me about tables:
1) They have no geometric bounds.
2) You can't use the duplicate method on them.
Why are tables setup like this? It seems to me that tables are interfaced with in a way that no other objects are.
Thanks for your thoughts.
1. Tables live in paragraphs, even constitute paragraphs, and since paragraphs have no geometric bounds, tables therefore have no geometric bounds either. But you can still get some information (a table's storyOffset returns an insertionPoint):
// Right-hand side of the table:
// Bottom of the table:
// Left-hand side of the table:
The top of the table is either the top of the text frame (if the table is in the first paragraph of a text frame) or can be derived from the baseline of the preceding paragraph.
2. Since tables live in their own paragraphs, and paragraphs can be duplicated, duplicating the table's parent paragraph therefore duplicates the table. To duplicate a table at the end of the story it occurs in, use this:
myTable.storyOffset.paragraphs.duplicate (LocationOptions.after, myTable.storyOffset.parentStory.insertionPoints);
Peter this was very helpful.