Save to HTML

General TRichView support forum. Please post your questions here
Post Reply
Aeperd
Posts: 20
Joined: Thu Dec 26, 2024 1:30 pm

Save to HTML

Post by Aeperd »

when i save to html the table becomes compress to the left, what did i miss? is it with richviewedit settings?
Attachments
Capture.JPG
Capture.JPG (68.93 KiB) Viewed 151451 times
Sergey Tkachenko
Site Admin
Posts: 17805
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Save to HTML

Post by Sergey Tkachenko »

Please send me this document as RVF and as HTML (to email richviewgmailcom)
Aeperd
Posts: 20
Joined: Thu Dec 26, 2024 1:30 pm

Re: Save to HTML

Post by Aeperd »

Sent Sir
Sergey Tkachenko
Site Admin
Posts: 17805
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Save to HTML

Post by Sergey Tkachenko »

This table does not have defined width (table.BestWidth = 0), and cells do not have defined widths as well (BestWidth = 0 for all cells).
Currently, TRichView and HTML browsers show such tables differently. HTML browsers use minimum possible width, while TRichView displays such a table as if it has width = 100%.
To avoid this problem, avoid using such tables:
- define width of at least one cell in each column in absolute units (pixels by default, assign BestWidth = 0)
and/or
- define table width (table.BestWidth)
Aeperd
Posts: 20
Joined: Thu Dec 26, 2024 1:30 pm

Re: Save to HTML

Post by Aeperd »

Noted sir with thanks
Aeperd
Posts: 20
Joined: Thu Dec 26, 2024 1:30 pm

Re: Save to HTML

Post by Aeperd »

By the way sir, can we assign the width of cells upon exporting to html? set table to autowidth?
Sergey Tkachenko
Site Admin
Posts: 17805
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Save to HTML

Post by Sergey Tkachenko »

For tables as a whole, assign table.BestWidth property. You can define width as
  • absolute units (pixels by default) or
  • percent of document width
  • default width (autosize)
As for the last value (default width), Currently, TRichView calculates default width as a sum of column widths only if the table has widths of all columns defined in percents. Otherwise, TRichView displays this table as if it has 100% width.

For cells, assign cell.BestWidth.
You can define width as
  • absolute units (pixels by default) or
  • percent of table width
  • default width (using remaining space after calculating width of columns defined in absolute units or percents)
If you generate tables in code, see the demo in TRichView\Demos\DelphiUnicode\Editors\Editor 1\.
It has an example of generation of 4 sample tables.
Aeperd
Posts: 20
Joined: Thu Dec 26, 2024 1:30 pm

Re: Save to HTML

Post by Aeperd »

Thanks a lot sir
Aeperd
Posts: 20
Joined: Thu Dec 26, 2024 1:30 pm

Re: Save to HTML

Post by Aeperd »

Happy New Year! May you and your family will be bless more with success and good health this 2025.
Post Reply