From: SpreadTooThin on
I have a number in a table and I need to format it (client side, no
java script or other) as KiloBytes, MegaBytes, GigaBytes, TeraBytes
etc....

So if the entry is:
< 2^10 = (entry/1024)KB
< 2^20 = (entry/2^20)KB
< 2^30...
< 2^40...

I hoped that with CSS I might format a table cell/column this way.
Is it possible?
From: Thomas 'PointedEars' Lahn on
SpreadTooThin wrote:

> I have a number in a table and I need to format it (client side, no
> java script or other) as KiloBytes, MegaBytes, GigaBytes, TeraBytes

There is no "java script", see also <http://PointedEars.de/es-matrix>

> etc....
>
> So if the entry is:
> < 2^10 = (entry/1024)KB
^^
> < 2^20 = (entry/2^20)KB
^^
> < 2^30...
> < 2^40...

The correct units for this would be KiB (Kibibytes = kilo-binary bytes),
MiB (Mibibytes = Mega-binary bytes), aso. (Few people get that right,
to the advantage of vendors of storage media who use the SI prefixes
correctly; many consumers buy a "500 GB" USB harddisk and wonder why it can
hold only 476 odd "GB" per their OS ["GiB" really, as proper OSs say].)

<http://en.wikipedia.org/wiki/Binary_prefix>

> I hoped that with CSS I might format a table cell/column this way.
> Is it possible?

No.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(a)news.demon.co.uk> (2004)
From: Jukka K. Korpela on
SpreadTooThin wrote:

> I have a number in a table and I need to format it (client side, no
> java script or other) as KiloBytes, MegaBytes, GigaBytes, TeraBytes
> etc....

(Javascript is normally used client-side, so I don't quite see the point in
your parenthetic remark.)

> I hoped that with CSS I might format a table cell/column this way.
> Is it possible?

No. I'm afraid you have completely wrong idea of what CSS is. It is not a
programming language at all.

Why would you include a number in an HTML document and then try to change it
to something else, instead of doing the conversion before the data is
entered in the HTML document?

--
Yucca, http://www.cs.tut.fi/~jkorpela/

From: Marious Barrier on
On 06/15/2010 10:54 AM, SpreadTooThin wrote:
> I have a number in a table and I need to format it (client side, no
> java script or other) as KiloBytes, MegaBytes, GigaBytes, TeraBytes
> etc....
>
> So if the entry is:
> < 2^10 = (entry/1024)KB
> < 2^20 = (entry/2^20)KB
> < 2^30...
> < 2^40...
>
> I hoped that with CSS I might format a table cell/column this way.
> Is it possible?

CSS has some data manipulation features but there is no one to do what
you want.

Now, if you want it Client-Side, the only way for that would be
Javascript. Why are you trying to avoid JS for this?