Search code examples
htmlcssalignment

aligning text in html


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 ?


Solution

  • Your code actually works, it's just hard to tell in your example. Take a look at this fiddle:

    http://jsfiddle.net/UzRdL/