Page 1 of 1

What options needed to autofit a table to content?

Posted: Tue Dec 04, 2012 11:09 am
by HeZa
What options needed to autofit a table to content?

if I set no Options/Bestwidth the table has the same width as the document and all cells have the same width and the width of all cells fit the table width.

What I "really" want is that a cell fit its content until a maximum width. When reaching maximum width content is word wraped.

Thanks in advance

Posted: Tue Dec 04, 2012 4:48 pm
by Sergey Tkachenko
Sorry, this feature is not implemented yet.

Posted: Tue Dec 04, 2012 5:52 pm
by HeZa
But only to fit (as an example) first column of a table to its largest content is possible?

At the moment I have something like this

Code: Select all

|                                     |
||a          |b          |c          ||
||a1 a2      |bbb1       |cc         ||
||aaa1       |b1         |c          ||
|                                     |
but I want something like this

Code: Select all

|                                     |
||a     |b    |c  |                   |
||a1 a2 |bbb1 |cc |                   |
||aaa1  |b1   |c  |                   |
|                                     |
Or with other words: What is to do to get the smallest column width without word wrap

Posted: Tue Dec 04, 2012 6:38 pm
by Sergey Tkachenko
Include rvpaoNoWrap in the paragraph's Options

Posted: Fri Dec 07, 2012 12:10 pm
by HeZa
Thanks, it works now.

Re: What options needed to autofit a table to content?

Posted: Thu Oct 29, 2020 9:53 pm
by jgkoehn
If I wanted to do rvpaoNoWrap in rtf what would be the appropriate rtf code that would turn this on?

Re: What options needed to autofit a table to content?

Posted: Fri Oct 30, 2020 1:30 pm
by Sergey Tkachenko
Unfortunately, AFAIK, RTF does not have keywords for turning off word wrapping in paragraph.
There is a keyword for cells, but it has limitation
\clNoWrap :
Do not wrap text for the cell. Only has an effect if the table cell does not have a preferred \clwWidthN, which overrides \trautofitN.

Re: What options needed to autofit a table to content?

Posted: Fri Oct 30, 2020 2:15 pm
by jgkoehn
This is good to know.
What I want to do is make a table of say 20 columns with yhe width dependent on the size of the words. It does not need to fit to view.

Re: What options needed to autofit a table to content?

Posted: Fri Oct 30, 2020 3:09 pm
by Sergey Tkachenko
With default settings, MS Word does not wrap inside words. So, if each cell contains one word, it's like a no-wrap option.

Re: What options needed to autofit a table to content?

Posted: Fri Oct 30, 2020 3:12 pm
by jgkoehn
Good to know.
Basically it will be content built in rtf a single table maybe text above it put into a sql and loaded as individual rtf files in TRichView so just checking on how to make it right.