Why tab is not aligned? If tab is not aligned, why is it called tab? Is there a way to make tabs aligned?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
There are lots of ways to get the kind of formatting you want. Here is one of them, which requires only a little modification of your code.
StandardForm does not support tabs or newlines like regular text editor. It doesn't make sense to do so considering variety of 2D typesetting available there.
One can't even type
\t unless it is a beginning of the line.
You should realize that even though it is possible to achieve some formatting of Wolfram Language output by creating strings which contain raw tabs and newlines, this is rarely a good idea. Typically a much better approach is to use the higher-level Wolfram Language formatting primitives [...
Columnetc]. These primitives will always yield consistent output, independent of such issues as the positions of tab settings on a particular device.
FormatType is set to
In practice this means that your input goes through
Cell @ BoxData @ ToBoxes @ input (roughly).
From what I've tried only
TextForm respects tabs. It is used in styles like
Code / Program / Text etc. Those cells contain
TextData or just plain string inside instead of
So the quick fix is:
Print @ TextCell["1\t55\n33\t44"]
Print @ RawBoxes @ Cell["1\t55\n33\t44"]
By the way, what documentation meant by "higher-level Wolfram Language formatting primitives" is something like:
Print @ Grid[ImportString["a\t55\n33\t44", "Table"], Alignment -> Left]