Reputation: 18551
I have the following rows in a css file
body {text-align: center;}
table {margin: 0 auto}
this causes to all text to be aligned to the middle. but in somse inner 's I want the text to be aligned right or left So I added
<table style="text-align:right;">
and the text was still centered. what shoud I add ?
Upvotes: 0
Views: 78
Reputation: 93
If you want only some of the text in the table to be right alignment.
then
<table>
<tr>
<td> Text </td>
<td style='text-align:right'> This text is align to right </td>
<td style='text-align:left'> This text is align to the left </td>
</tr>
</table>
Upvotes: 1
Reputation: 76766
Your code actually works, it's just hard to tell in your example. Take a look at this fiddle:
Upvotes: 2
Reputation: 954
I guess the table is centered due to the parent div (body). I'll use a div with 100% width and align the text inside it to the right Or float the div or table to the rigth
Upvotes: 1
Reputation: 1793
Please add style="text-align:right" with td
. i think it will be work.
thanks
Upvotes: 2