Page 1 of 1

Save to HTML

Posted: Sun Dec 29, 2024 3:49 pm
by Aeperd
when i save to html the table becomes compress to the left, what did i miss? is it with richviewedit settings?

Re: Save to HTML

Posted: Sun Dec 29, 2024 4:22 pm
by Sergey Tkachenko
Please send me this document as RVF and as HTML (to email richviewgmailcom)

Re: Save to HTML

Posted: Mon Dec 30, 2024 12:08 am
by Aeperd
Sent Sir

Re: Save to HTML

Posted: Mon Dec 30, 2024 12:55 pm
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)

Re: Save to HTML

Posted: Mon Dec 30, 2024 11:47 pm
by Aeperd
Noted sir with thanks

Re: Save to HTML

Posted: Tue Dec 31, 2024 12:35 am
by Aeperd
By the way sir, can we assign the width of cells upon exporting to html? set table to autowidth?

Re: Save to HTML

Posted: Tue Dec 31, 2024 8:33 am
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.

Re: Save to HTML

Posted: Thu Jan 02, 2025 6:11 am
by Aeperd
Thanks a lot sir

Re: Save to HTML

Posted: Thu Jan 02, 2025 6:12 am
by Aeperd
Happy New Year! May you and your family will be bless more with success and good health this 2025.