Element "align" is obsolete or non-standard: what should I use instead?

hotcoder picture hotcoder · Aug 18, 2011 · Viewed 28.7k times · Source

I have this HTML code:

<td align="center">

and I'm getting this error in Visual Studio 2008 from ReSharper:

"Element 'align' is obsolete or nonstandard"

What is the replacement of this code to make it standard?

Answer

Jamie Dixon picture Jamie Dixon · Aug 18, 2011

You should use text-align in CSS rather than using the obsolete html styling attributes.

td{
text-align:center;
}