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

Discussion in 'HTML' started by jaykchan@hotmail.com, Jun 28, 2005.

  1. Guest

    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
     
    , Jun 28, 2005
    #1
    1. Advertising

  2. Ian Rastall Guest

    On 28 Jun 2005 12:09:50 -0700, wrote:

    >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
    --
    Was it not a comedy, a strange and stupid
    matter, this repetition, this running around
    in a fateful circle? (Hermann Hesse)
    http://www.bookstacks.org/
     
    Ian Rastall, Jun 28, 2005
    #2
    1. Advertising

  3. AF Guest

    On Tue, 28 Jun 2005 16:14:12 -0400, Ian Rastall <>
    wrote:

    >On 28 Jun 2005 12:09:50 -0700, wrote:
    >
    >>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


    Ian,

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


    Best regards,

    Al
    http://www.affordablefloridainsurance.com
    http://www.americanbestmortgages.com
    http://www.americanaffordablelifeinsurance.com
     
    AF, Jun 29, 2005
    #3
  4. Ian Rastall Guest

    On Wed, 29 Jun 2005 02:28:41 GMT, AF <bscinc3000@Yahoo_NoSpam.com>
    wrote:

    >On Tue, 28 Jun 2005 16:14:12 -0400, Ian Rastall <>
    >wrote:
    >
    >>Perhaps something like:
    >>
    >><div class="left" style="float: left;">Some text</div>
    >><div class="right">Some more text</div>

    >
    >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
    --
    Was it not a comedy, a strange and stupid
    matter, this repetition, this running around
    in a fateful circle? (Hermann Hesse)
    http://www.bookstacks.org/
     
    Ian Rastall, Jun 29, 2005
    #4
  5. AF Guest

    On Tue, 28 Jun 2005 22:39:10 -0400, Ian Rastall <>
    wrote:

    >On Wed, 29 Jun 2005 02:28:41 GMT, AF <bscinc3000@Yahoo_NoSpam.com>
    >wrote:
    >
    >>On Tue, 28 Jun 2005 16:14:12 -0400, Ian Rastall <>
    >>wrote:
    >>
    >>>Perhaps something like:
    >>>
    >>><div class="left" style="float: left;">Some text</div>
    >>><div class="right">Some more text</div>

    >>
    >>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


    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
     
    AF, Jun 29, 2005
    #5
  6. Ian Rastall Guest

    On Wed, 29 Jun 2005 11:29:15 GMT, AF <bscinc3000@Yahoo_NoSpam.com>
    wrote:

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


    It's no big deal. Glad it worked out for you!

    Ian
    --
    Was it not a comedy, a strange and stupid
    matter, this repetition, this running around
    in a fateful circle? (Hermann Hesse)
    http://www.bookstacks.org/
     
    Ian Rastall, Jun 29, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    7
    Views:
    5,720
    Joe Smith
    Jul 22, 2004
  2. John Salerno

    left and right align on the same line

    John Salerno, Feb 11, 2006, in forum: HTML
    Replies:
    10
    Views:
    11,939
    Jonathan N. Little
    Feb 13, 2006
  3. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Left justified or center justified under XSL:FO

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Feb 9, 2007, in forum: XML
    Replies:
    0
    Views:
    514
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Feb 9, 2007
  4. Ben Thomas
    Replies:
    7
    Views:
    308
    Jan Svitok
    Nov 16, 2006
  5. Thomas Blabb
    Replies:
    3
    Views:
    292
    Paul Lalli
    Nov 16, 2007
Loading...

Share This Page