7.2.2.1 Tabellen zum vertikalen Ausrichten von Zeichen (Bsp. Schriftliches Rechnen)

Problembeschreibung:

  • Beim Schriftlichen Rechnen soll eine korrekte Ausrichtung erreicht werden.
  • Operationszeichen sollen untereinander stehen. Eine horizontale Linie soll die Rechnung von dem Ergebnis trennen.

Lösungsansatz:

  • Tabellen nutzen und die Ausrichtung mit dem style-Attribut vornehmen.
  • Striche können als "border" oder als <hr> gesetzt werden.
Beispiel

Variante 1: Als einfacher Text

  monatliches Einkommen € 20.000

- monatliche Abzüge         €   5.000
___________________________
= (restliche) Buchwert      € 15.000

Variante 2: Als Tabelle mit formatiertem Rahmen

monatliches Einkommen 20.000
- monatliche Abzüge 5.000
= (restliche) Buchwert 15.000

{| |- | | monatliches Einkommen | € | style="text-align:right;" | 20.000 |- | style="text-align:center;border-bottom:1px solid black;" | - | style="border-bottom:1px solid black;" | monatliche Abzüge | style="border-bottom:1px solid black;" | € | style="text-align:right;border-bottom:1px solid black;" | 5.000 |- | = | style="font-weight:bold;" | (restliche) Buchwert | € | style="font-weight:bold;" | 15.000 |}

Variante 3: Tabelle mit zusätzlicher Zeile und formatierter horizontaler Linie per <hr>-Tag

monatliches Einkommen 20.000
- monatliche Abzüge 5.000

= (restliche) Buchwert 15.000

{| |- | | monatliches Einkommen | € | style="text-align:right;" | 20.000 |- | style="text-align:center;" | - | monatliche Abzüge | style="" | € | style="text-align:right;" | 5.000 |- | colspan="4" style="margin:0px;padding:0px;"| <hr style="border:0.5px solid black;margin:0px;"> |- | = | style="font-weight:bold;" | (restliche) Buchwert | € | style="font-weight:bold;" | 15.000 |}