Setting cell widths in a table

The Application Programming Interface and the OASIS Open Document Format

Setting cell widths in a table

Postby RhinoCan » Tue Feb 19, 2013 11:50 pm

I'm writing a Java program to generate a document using the UNO API. Part of my document contains some small tables that are a single row with 4 cells in them. How do I set the width of the cells manually to a number of my choosing? It appears that the cells are made equal size by default, which is reasonable, but I don't actually _want_ them equal in size. Instead, I want to be able to say that the first cell is 2.4 inches (or the equivalent in cm or points or whatever units are in use).

An example would be especially helpful but anything would be useful.
OpenOffice 4.1.2 and Libre Office 5.2.3.3 on Windows 10
User avatar
RhinoCan
 
Posts: 80
Joined: Fri Jun 10, 2011 11:36 pm

Re: Setting cell widths in a table

Postby FJCC » Wed Feb 20, 2013 7:24 am

See this thread especially near the end. A comment by Bernard Marcelly suggests there is a problem with setting column widths with version 3.3, but I can't get at the linked post at the moment. I could not get the suggested method to work in version 3.4 either.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8126
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Setting cell widths in a table

Postby B Marcelly » Wed Feb 20, 2013 8:10 am

Hi,
:arrow: FJCC : the problem I was referring to was a bug in COM-Automation, used by an external language. No relation with text tables.

Setting column width in a Writer text table has been answered many times in this forum. Look for TableColumnSeparators. Example:
viewtopic.php?f=44&t=4199
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
B Marcelly
Volunteer
 
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Setting cell widths in a table

Postby FJCC » Wed Feb 20, 2013 2:56 pm

Thanks for clearing that up, Bernard. I was using the TableColumnSeparator and not getting any result. There was no error, just no response. It was late for me and I was probably doing something stupid.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8126
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 2 guests