HTML :td

Fairlight fairlite at fairlite.com
Thu Aug 21 12:20:14 PDT 2008


On Thu, Aug 21, 2008 at 11:24:24AM -0700, Enrique Arredondo may or may not have
proven themselves an utter git by pronouncing:
> How can I specify with :td to wrap every 20 characters ?
> 
> html id :td :wi "20" :zz "WRAP" ?

No.

Widths of table cells are either pixels, or if a percent sign is appended
(ie., "20%") then that percentage width of the overall innermost table
width.

To specify wrap at 20 characters, you'd need to use a fixed-width font,
make sure the browser could not change that font size (much harder these
days), and figure necessary pixels per character times 20.  Even then, it's
not foolproof, as the cell and table widths vary via a multi-pass algorithm
that reconfigures width based on requested size, overflow rules, and
composite results of multiple requested sizes (eg., if you ask for cells in
a column to be varying sizes, the result isn't guaranteed...usually you'll
get the largest, but it's not bankable).  This multipass alogorithm is why
tables are slow to display when large, and won't display at all until the
entire table is received in the data stream.

You could try to put a DIV in the cell that goes by fixed width font and
pixel count, but again, no guarantees--most browsers can override font
family, name, size, etc.

TTBOMK, there is no foolproof way to guarantee your desired result, short
of using form elements like:  <INPUT TYPE="TEXT" SIZE="20" MAXLENGTH="20">

mark->
-- 
"Moral cowardice will surely be written as the cause on the death
certificate of what used to be Western Civilization." --James P. Hogan


More information about the Filepro-list mailing list