Right justified equation numbers w/o tables

Discussion in 'HTML' started by nobody, Dec 14, 2004.

  1. nobody

    nobody Guest

    Greetings. I want to put a bunch of equations with right justified
    numbers on the same line as the equation but I cannot seem to find a
    way of doing this w/o tables, which is really a PITA. I tried
    everything I can think of in the Span styles but since I cannot get to
    specify a width as "all the remaining space", it doesn't seem to work.
    Is there no way of doing this w/o tables? Thanks.

    DIV.Math {
    font : bold larger "Courier New", Courier, monospace;
    color : Navy;
    margin : 6px 8% 6px 8%;
    width : 100%;
    }

    SPAN.EqNo {
    font : normal italic "Times New Roman", Times, serif;
    color : Maroon;
    ???
    }

    ....

    <div class="math">P = B + C<span class="eqno">[3]</span></div>
     
    nobody, Dec 14, 2004
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed nobody <> writing
    in news::

    > Greetings. I want to put a bunch of equations with right justified
    > numbers on the same line as the equation but I cannot seem to find a
    > way of doing this w/o tables, which is really a PITA. I tried
    > everything I can think of in the Span styles but since I cannot get to
    > specify a width as "all the remaining space", it doesn't seem to work.
    > Is there no way of doing this w/o tables? Thanks.
    >
    > DIV.Math {
    > font : bold larger "Courier New", Courier, monospace;
    > color : Navy;
    > margin : 6px 8% 6px 8%;
    > width : 100%;
    > }
    >
    > SPAN.EqNo {
    > font : normal italic "Times New Roman", Times, serif;
    > color : Maroon;
    > ???
    > }
    >
    > ...
    >
    > <div class="math">P = B + C<span class="eqno">[3]</span></div>
    >
    >


    Is there a reason why tables wouldn't work... after all if I were doing
    something with math, I would probably open a spreadsheet.

    --
    Adrienne Boswell
    Please respond to the Group so others can share
     
    Adrienne Boswell, Dec 14, 2004
    #2
    1. Advertising

  3. nobody

    rf Guest

    nobody wrote:

    > Greetings. I want to put a bunch of equations with right justified
    > numbers on the same line as the equation


    Like in a maths text book?

    ..math {text-align: right;}
    ..math span {float: left;}

    <div class="math"><span>P = B + C </span>[3]</div>

    --
    Cheers
    Richard.
     
    rf, Dec 14, 2004
    #3
  4. nobody

    nobody Guest

    On Tue, 14 Dec 2004 05:39:07 GMT, "rf" <rf@.invalid> wrote:
    >nobody wrote:


    >> Greetings. I want to put a bunch of equations with right justified
    >> numbers on the same line as the equation


    >Like in a maths text book?
    >
    >.math {text-align: right;}
    >.math span {float: left;}
    >
    ><div class="math"><span>P = B + C </span>[3]</div>


    That's it! Thank you. I was trying instead to float the eq. number to
    the right and it was going on the next line.
     
    nobody, Dec 14, 2004
    #4
  5. nobody

    Toby Inkster Guest

    Adrienne Boswell wrote:

    > Is there a reason why tables wouldn't work... after all if I were doing
    > something with math, I would probably open a spreadsheet.


    That's only because you don't have a proper maths package. (Mathematica,
    Maple, et al.)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Dec 14, 2004
    #5
  6. nobody <> wrote:

    >>> Greetings. I want to put a bunch of equations with right justified
    >>> numbers on the same line as the equation

    >
    >>Like in a maths text book?
    >>
    >>.math {text-align: right;}
    >>.math span {float: left;}
    >>
    >><div class="math"><span>P = B + C </span>[3]</div>

    >
    > That's it!


    Well, not quite. What happens if the equation itself gets divided into
    two or more lines?

    > I was trying instead to float the eq. number to
    > the right and it was going on the next line.


    The problem with that is that floating makes an element a block
    element. If you put the equation number before the equation in markup,
    you could make it float to right the intended way - but only when the
    equation fits onto one line. Dealing with potentially multi-line
    equations makes things tricky. Positioning is one approach but then you
    have problems with old browsers like IE - they don't do positioning
    well in other than fairly simple cases.

    So a table _is_ the practical solution, and not necessarily illogical:

    <table class="eq" summary="Equation and its number." width="100%">
    <tr>
    <td>the equation</td>
    <th align="right" valign="bottom">(number)</th>
    </tr>
    </table>

    I just wrote some additional notes on this:
    http://www.cs.tut.fi/~jkorpela/math/#eqno

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Dec 14, 2004
    #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. Replies:
    5
    Views:
    1,145
    Ian Rastall
    Jun 29, 2005
  2. =?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:
    515
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Feb 9, 2007
  3. trbosjek

    print unsigned long long right justified

    trbosjek, Jul 3, 2007, in forum: C Programming
    Replies:
    8
    Views:
    371
    CBFalconer
    Jul 4, 2007
  4. Catherina Svensson
    Replies:
    0
    Views:
    324
    Catherina Svensson
    Apr 29, 2008
  5. Ben Thomas
    Replies:
    7
    Views:
    310
    Jan Svitok
    Nov 16, 2006
Loading...

Share This Page