Interview Questions

How do I align a table to the right (or left)?

HTML Interview Questions and Answers


(Continued from previous question...)

10. How do I align a table to the right (or left)?

You can use <TABLE ALIGN="right"> to float a table to the right. (Use ALIGN="left" to float it to the left.) Any content that follows the closing </TABLE> tag will flow around the table. Use <BR CLEAR="right"> or <BR CLEAR="all"> to mark the end of the text that is to flow around the table, as shown in this example:

The table in this example will float to the right.
<table align="right">...</table>
This text will wrap to fill the available space to the left of (and if the text is long enough, below) the table.
<br clear="right">
This text will appear below the table, even if there is additional room to its left.

(Continued on next question...)

Other Interview Questions