HTML table center / right justify

G

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
 
B

Beauregard T. Shagnasty

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: <td class="price">$123.45</td>
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top