Table Alignment

Section 1 - Introduction
Section 2 - Basics
Section 3 - Next Level
      Lists
      Basic Tables
         Table basics
         Rows and data
         Borders
         Width
         Cellpadding & spacing
         Alignment
         Rowspan & colspan
         You Try It
      Advanced Text
      Marquee
      Meta
      Sounds
      Comments
Section 4 - Advanced
Section 5 - Publishing
Section 6 - Extras
Appendices
Table alignment
TAGS USED: <table align=""> and <td align="">
Much like images, you can align you table to fit into your document better. The first way this can be done is by aligning the whole table. This is done within the <table&rt; command. You can align youtable to be left or right. Here's that in action. We'll use a two-cell table with a picture in one cell for our example.
Code
<table border=1 align="right">
<tr>
<td> <img src="hapmonk.jpg">
</td>
<td width=90>
This is a picture of the cutest monkey I found on the internet today. </td>
</tr>
</table>
Here is a bunch of text I just made up about monkeys. Monkeys may be horribly cute, but they're evil creatures. Never keep one as a pet. A twenty-pound monkey is more than a match for a full-grown adult human.

What you see
This is a picture of the cutest monkey I found on the internet today.
Here is a bunch of text I just made up about monkeys. Monkeys may be horribly cute, but they're evil creatures. Never keep one as a pet. A twenty-pound monkey is more than a match for a full-grown adult human.
What do you do if you want the table in the center of the page? Just put the <center> and </center> tags around it. You can't put text on the side of the table if you do this though.

The commands you've learned will align the entire table to one direction or another, but what if you only want to mess with one cell of a table? Instead of modifying the <table> command, just modify the <td> command.
Code
<table border=1 align="left" width=80%>
<tr>
<td align=center> <img src="hapmonk.jpg">
</td>
<td width=90 align=right>
This is a picture of the cutest monkey I found on the internet today. </td>
</tr>
</table>

Words go here.

What you see
This is a picture of the cutest monkey I found on the internet today.
Words go here.


So, in summary, you can align your table, you can align the data in the table, and anything else you need to. With a little practice, you can put tables anywhere you'd like.
Back Home Forward