HTML table center / right justify
am 01.05.2007 16:32:35 von G
I need to figure out how to center, right justified data as shown in
the table below.
http://oisurf.com/sillypix/table_ex1.jpg
The price columns show right justification, and then centered data.
The only (work intensive) way that I can think of is to create a table
for each cell. Each table would contain 3 columns and 1 row. The
middle row would contain the price data and the 1st and 3rd column
would just be spacing to "center" the price.
Any acute htmlers know a simplier or more efficient way (less work
intensive). Maybe using CSS?
Thanks
George Scapin
Re: HTML table center / right justify
am 01.05.2007 18:17:21 von a.nony.mous
g@thescapins.com wrote:
> I need to figure out how to center, right justified data as shown in
> the table below.
>
> http://oisurf.com/sillypix/table_ex1.jpg
Normally, prices are not 'centered', they are in fact right-justified
(or more correctly aligned on the decimal point, as your image seems to
be).
> The price columns show right justification, and then centered data.
>
> The only (work intensive) way that I can think of is to create a table
> for each cell. Each table would contain 3 columns and 1 row. The
> middle row would contain the price data and the 1st and 3rd column
> would just be spacing to "center" the price.
Bah! A complete table just for spacing?
> Any acute htmlers know a simplier or more efficient way (less work
> intensive). Maybe using CSS?
CSS: .price { padding: 0 1em; text-align: right; }
HTML:
$123.45 |
--
-bts
-Motorcycles defy gravity; cars just suck