How to Put Both Left-Justified Text and Right-Justified Text on the Same Line?

J

jaykchan

I would like to know whether there is a way to put left-justified line
and right-justified line in the same line. I am trying to format the
report heading in a way that I have left-justified text and
right-justified text flanking the left and right sides of the report
heading. Because the web page is dynamically generated and each user's
screen can be different, I cannot pre-define the report heading as a
static web page.

I have tried using the 'align' attribute in <p> or <div>. But this
doesn't work because the left-justified text and the right-justified
text will always be placed in two different lines, and I want them to
be on the same line.

I have also tried to put them in a bordless table. But I have already
had a large table in the body of the web page that will be larger than
the bordless table; this means the bordless table will not be covering
the full width of the web page, and I cannot achieve the effect of
having left-justified text and right-justified text.

Any idea?

Thanks in advance for any information.

Jay Chan
 
I

Ian Rastall

I have tried using the 'align' attribute in <p> or <div>. But this
doesn't work because the left-justified text and the right-justified
text will always be placed in two different lines, and I want them to
be on the same line.

Perhaps something like:

<div class="left" style="float: left;">Some text</div>
<div class="right">Some more text</div>

HTH

Ian
 
I

Ian Rastall

I tried your suggestion in both FrontPage and hand coded, and it did
not work.

Do you have anything in your CSS for the .left and .right classes that
I refer to in there? If not, you might try:

<div style="float: left; text-align: left;">Some text</div>
<div style="text-align: right">Some more text</div>

If that doesn't work ... I'm out of ideas! :)

Ian
 
A

AF

Do you have anything in your CSS for the .left and .right classes that
I refer to in there? If not, you might try:

<div style="float: left; text-align: left;">Some text</div>
<div style="text-align: right">Some more text</div>

If that doesn't work ... I'm out of ideas! :)

Ian

Ian,

You are right.

I missed the "class" and css implications in your first example.
Sorry. I most humbly apologize.

I just tried your second example, and it worked beautifully.

When I have a little more time, I will try your css example, but it
looks like it will work.

Again I apologize for my mistake.

And I sincerely appreciate the lesson in html and css you have given.


Best regards,

Al
http://www.affordablefloridainsurance.com
http://www.americanbestmortgages.com
http://www.americanaffordablelifeinsurance.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top