PDA

View Full Version : aligning left and right?


EscapeCharacter
08-05-2003, 12:07 PM
is it possible on the same line to have some stuff aligned left and other stuff aligned to the right? something like the following


<div align="left">stuff i want left</div><div align="right">stuff on the right</div>

this doesnt work as each div is on its own line. i know i can do it by having a two column table and setting each cell to the correct alignment but i was just wondering if there is another way to do it.

Dru Lee Parsec
08-05-2003, 12:45 PM
I would do it with a table with 2 TD tags in one TR tag. THe left TD would have the property align="left" and the right tag would have align="right". There may be other ways to do it, but that's the first idea I came up with.

Here's an example:

<html>
<head>
</head><body>
<table size="600" border="1">
<tr>
<td width="300" align="LEFT">Left Justified Text</td>
<td width="300" align="RIGHT">Right Justified Text</td>
</tr>
</table>
</body>
</html>


If you don't want to see the border lines then take out the border="1" part of the table tag.

jamessan
08-05-2003, 12:45 PM
I'm pretty sure you could do enclose the text in a span with style="float:left;" or style="float:right;" according to what you want. Tables aren't supposed to be used for layout. I'd highly recommend looking into CSS unless you are actually displaying tabular data.

EscapeCharacter
08-05-2003, 01:02 PM
cool that span thing worked out fine