Home > Back-end >  Rookie question, why CMD effect and the eclipse effect cannot be aligned, how should solve???????
Rookie question, why CMD effect and the eclipse effect cannot be aligned, how should solve???????

Time:10-11



output, after the name is not equal to the number of words, but behind the "age" this two word can be aligned, but behind the 12 July, these two characters are different, but why later on not neat??





code are the same, from TXT copied, eclipse is not neat, before facing on behind can align again??? This is why??????


to ask: how to do regardless of input characters in length, can do some before and after pictures in this alignment???????

CodePudding user response:

Use the/t/n/r this kind of special character, instead of lost space https://blog.csdn.net/weixin_43876121/article/details/103135569 off hand

CodePudding user response:

The output of each column length under control, such as
System. The out. Printf (" % 5 ", name);
System. The out. Printf (" % 5 ", the age);
System.out.println();

CodePudding user response:

Are you not see my code? I am using is \ t, not hand input Spaces

CodePudding user response:

Two \ t try, not three, four...

CodePudding user response:

Tried, or not, has nothing to do with a few \ t

CodePudding user response:

Strange, I can use the idea of running alignment

CodePudding user response:

refer to the second floor KeepSayingNo response:
under the control of the output of each column length, such as
System. The out. Printf (" % 5 ", name);
System. The out. Printf (" % 5 ", the age);
System.out.println();



Should be put in what position??????? I plugged in the toString, the effect is as follows:

I didn't try the position of the other,,,,,,,, please expert advice, thank you

CodePudding user response:

May be the cause of the font,

CodePudding user response:

refer to 6th floor fengchuiqi_ response:
, I used the idea of running to align


And both before and after you \ t effect is the same, both before and after is \ t result is equal to the distance,
While my two \ t before and after effect still not the same, is the effect of two \ t out before and after is distance is not equal,

Is really strange,,,,

CodePudding user response:

refer to the eighth floor icoolno1 response:
may be the cause of the font,


just tried it once, the inside of the eclipse problem has been solved, adjust the inside of the console console font is ok,,,,

But, adjust the font to use within the CMD, already tried all fonts,,,,,,,, and not the same as the console inside the font,,,, so or CMD inside is the same,,,,,,, but also want to thank you first, after all, to solve the part of the problem
  • Related