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