I want to create a worksheet addition of, say, two five digit numbers. Using text-decoration:underline;, I get something like the following:
12345
+ 12345
-------
Wrapping in a div and using
style="width: 8em; margin: 1em; font-family: courier; text-align: right;"
gives me something like the following:
12345
+ 12345
-------
which is marginally better than before. How would accomplish aligning the digits on the ones? To be clear, the digits will be the same length, but the best answer would be robust to two digits of size m and n where m does not necessarily equal n, but I’m willing to trade robustness for not requiring javascript.
12345
+ 12345
-------
^---- align the ones digit
Thanks in advance!
This was rather fun to put together: Live Demo.
Note: Only tested on Firefox!
HTML:
CSS: