Table width to HTML

General TRichView support forum. Please post your questions here
Post Reply
vega
Posts: 50
Joined: Fri Oct 26, 2007 6:29 am

Table width to HTML

Post by vega »

I use RVE to generate HTML to make simple web pages. I use (D7) TWebBrowser (...) to preview the result. For technical reasons, I have to programmatically wrap the entire resulting HTML into a <div> before preview. The table width is used to set the width of this .div in px.

If the user creates a table 1 row, 2 cols 600px wide table then puts a 400px wide picture into each cell, at export time, the wrapping .div will be 600px wide (= table width) but it needs to be at least 800px (+ border, padding etc.) to be cross-browser.

Is there a way to override the table width at export time according to the specified width (if any) of the cells contents (also taking cellpadding, cellspacing and border into account would be awesome).

My concern is that in the above case, the non-compliant preview (TWebBrowser) makes the user believe that everything is OK (IE wrongly expands the wrapping .div as you know), but the resulting HTML will be broken in any compliant browser (FF, Opera etc).

(Personal wish : Someone please shoot IE! :roll: )
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, there is no way to modify how table is saved.
BestWidth property of cell/table are used to save <td width> and <table width>.
But I am not completely understand what you want to override.
For example, how do you want to calculate the actual table width (800px in your example)? This calculation may be very complicated, algorithms for calculating table width is different in different browsers and in TRichView.
Post Reply