기존에는 어떤 오브젝트라도 가운데로 정렬하기 위해 아래와 같은 코드를 사용해 왔습니다.
<code html>
<table align="center">...
<div align="center">...
</code>
이것을 CSS기반으로 수정한다면
<code html>
<table style="text-align: center;">...
<div style="text-align: center;">...
</code>
위와 같이 사용할 수 있는데, 이것은 블럭 레벨 오브젝트(table,div,p etc) 안에 있는 인라인 오브젝트(일반 텍스트, img etc)에만 적용되는 값입니다.\\
기존의 속성과 동일하게 블럭 레벨 오브젝트를 중간에 배치하고 싶다면 해당 오브젝트에 아래와 같이 margin을 사용합니다.
<code html>
<table style="margin: 0 auto;">...
</code>
또는
<code css>
table {
margin: 0 auto;
}
</code>
단, 사용시에는 아래와 같은 조건이 충족되어야 합니다.