Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Right justified equation numbers w/o tables

Reply
Thread Tools

Right justified equation numbers w/o tables

 
 
nobody
Guest
Posts: n/a
 
      12-14-2004
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>

 
Reply With Quote
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      12-14-2004
Gazing into my crystal ball I observed nobody <(E-Mail Removed)> writing
in news:(E-Mail Removed):

> 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
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      12-14-2004
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.


 
Reply With Quote
 
nobody
Guest
Posts: n/a
 
      12-14-2004
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.

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      12-14-2004
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

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      12-14-2004
nobody <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I write right-justified into a 12 chars width field? Catherina Svensson Java 0 04-29-2008 06:23 PM
print unsigned long long right justified trbosjek C Programming 8 07-03-2007 11:04 PM
Left justified or center justified under XSL:FO =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= XML 0 02-09-2007 08:14 PM
Fully justified/center justified output Ben Thomas Ruby 7 11-16-2006 08:28 AM
How to Put Both Left-Justified Text and Right-Justified Text on the Same Line? jaykchan@hotmail.com HTML 5 06-29-2005 07:01 PM



Advertisments