What options needed to autofit a table to content?

General TRichView support forum. Please post your questions here
Post Reply
HeZa
Posts: 3
Joined: Sun Oct 14, 2012 7:22 pm

What options needed to autofit a table to content?

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, this feature is not implemented yet.
HeZa
Posts: 3
Joined: Sun Oct 14, 2012 7:22 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Include rvpaoNoWrap in the paragraph's Options
HeZa
Posts: 3
Joined: Sun Oct 14, 2012 7:22 pm

Post by HeZa »

Thanks, it works now.
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

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

Post by jgkoehn »

If I wanted to do rvpaoNoWrap in rtf what would be the appropriate rtf code that would turn this on?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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

Post 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.
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

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

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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

Post 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.
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

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

Post 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.
Post Reply