I am trying to align some content in a td to the right. align=”right” works but text-align:right does not. Here’s a jsfiddle example that shows the two cases. The two cases are the same except for right aligning the right column. As you can see, in the second case, ‘button 1″ is aligned to the left when I was expecting it to be aligned to the right.
Addition:
I am using third party controls which add the tables. So no “You should use css and not tables discussions please”.
text-alignaligns text. It does not affect block-level elements like nested tables.align="right", on the other hand, aligns everything in a brute-force manner (akin to<center>).Nested tables are generally a horrible idea anyway, so should be avoided. If you must use a nested table, apply
margin-left: auto;to the nested table to have it aligned to the right.