Making a table in macro

Hi,
How do I create a table using basic macro in LibreOffice writer?
I need to get information from another document and insert it to a table in LibreOffice writer, and the table needs to be sized according to the amount of information in the first document.

Thanks!

Do you know the famous texts by Andrew Pitonyak?
(See also the table under “My Main Downloads” there.)
Most questions concerning the handling of TextTable objects by user code (via the API) don’t allow for a short answer.