How do I center a table?
HTML Interview Questions and Answers
(Continued from previous question...)
12. How do I center a table?
In your HTML, use
<div class="center">
<table>...</table>
</div>
In your CSS, use
div.center {
text-align: center;
}
div.center table {
margin-left: auto;
margin-right: auto;
text-align: left;
}
(Continued on next question...)
Other Interview Questions
|