deepseapanda
deepseapanda

Reputation: 3897

Centering uneven rows within a centered table

I am attempting to center a table and its rows in CSS.

I can center the table fine using:

table.Center
{
    margin-left:auto; 
    margin-right:auto;
}

But when I try and call something similar on the table row I end up with the result below:

http://i45.tinypic.com/259va.jpg

The desired result being:

 XX
XXXX
XXXX

Used two instead of three for the sake of the visual.

How can I center the table row to the page?

Upvotes: 0

Views: 255

Answers (1)

Chocimier
Chocimier

Reputation: 46

CSS solution:

table {
    text-align:center
}
td {
    display:inline-block
}​

http://jsfiddle.net/gz3X2/

Upvotes: 3

Related Questions