Tabstop at decimal point

S

Stefan

Hi,

does anyone know, how to make a Tabstop at the decimal-point like Word
can do? I did'nt want use the code, gereatet by word, because it is to
fat. For nearly 1 K of Source-Data, there was generatet a HTML-Doc with
over 100 K. I hope, anyone Knows a better way.
 
J

Jukka K. Korpela

Stefan said:
does anyone know, how to make a Tabstop at the decimal-point like Word
can do?

Basically, you don't, but you can simulate it if you are willing to
do some extra work. All methods are more or less awkward, and the method
defined in the HTML specifications does _not_ work. Here's one trick:
- right-pad the numbers in a column of a table so that they have the
same number of characters after the decimal separator; if you don't
like padding with zeros, use
- no-break spaces and a monospace font
- the figure space character and a font that contains it
- <span class="dummy">00</span> with
.dummy { color: white; background: white; } in CSS
(with the risk that indexing robots think you're spamming)
- align the cells to the right (<td align="right"> in each cell,
or some technique that has the same effect - beware of browser
differences then, since e.g. <col align="right"> should not work
though it works on IE)

(Can you make Word present a table with columns aligned on the decimal
separator? I didn't know that. Or do you mean writing something in a tabular-
like manner but not as a table? This is mildly HTML-related, since you could
then take a look at the HTML that Word spits out, first as rendered - does it
preserve the alignment? - and then maybe at the source level if you dare.)
I did'nt want use the code, gereatet by word, because it is to
fat.

It can be made smaller by saving as "compact" or "filtered" HTML and by
doing some additional cleanup like removing the said:
For nearly 1 K of Source-Data, there was generatet a HTML-Doc with
over 100 K.

I didn't know Source-Data was a temperature!
 
B

Barbara de Zoete

Basically, you don't, but you can simulate it if you are willing to
do some extra work. All methods are more or less awkward, and the method
defined in the HTML specifications does _not_ work.

Looking at:
- on text alignment, general:
<URL:http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-align>
- on text alignment in table columns:
<URL:http://www.w3.org/TR/REC-CSS2/tables.html#column-alignment>
- on strings as property values:
<URL:http://www.w3.org/TR/REC-CSS2/syndata.html#strings>

Is there any browser that implements the CSS2 style [ td { text-align:"."
} ] correctly? It is not that hard to imagine that, especially with
tabular data, one would like the numeric values of one column aligned at
the decimal-point. People have been doing that since book-keeping was
invented or before. :)

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
J

Jukka K. Korpela

Barbara de Zoete said:
Is there any browser that implements the CSS2 style [ td { text-align:"."
} ] correctly?

No. At least no browser worth mentioning. It's as hopeless as trying to
use align="char" in HTML.
It is not that hard to imagine that, especially with
tabular data, one would like the numeric values of one column aligned at
the decimal-point. People have been doing that since book-keeping was
invented or before. :)

Certainly, but they seem to have become incapable of doing so on web pages.
Even columns with integers aren't usually aligned to the right, making tables
often _quite_ weird-looking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top