Why is \t not being applied to this string?

Viewed 73

Almost trivial to ask, but i'm confused and curious. Why is the "\t" special character not applying a tab for:

image1

It looks like the "\t" character only applied a single space rather than a tab. However if I move the "\t" character over, it applies it like so

image2

Any ideas?

1 Answers

'Tabs' are actually applied. Tabs' width is usually determined by your terminal. In StackOverflow's (web-fronted) case, it's 4 characters wide. Output goes like this.

    b
a   b
aa  b
aaa b
aaaa    b
aaaaa   b
aaaaaa  b
aaaaaaa b
aaaaaaaa    b
aaaaaaaaa   b
aaaaaaaaaa  b
aaaaaaaaaaa b
aaaaaaaaaaaa    b
aaaaaaaaaaaaa   b
aaaaaaaaaaaaaa  b
aaaaaaaaaaaaaaa b

Not really an answer but explains the problem well.

Related