I am trying to format a file output so that everything is lined up nicely, and its almost working. I've used \t to try to give the output a uniform rigid look. It is almost there, but it isn't quite working for one (see below) I think it is because the team name is too short, but I'm not sure any suggestions?
My Code:
while ((str = in.readLine()) != null) {
Team newTeam = new Team(str);
teamArray[counter] = newTeam;
out.println(newTeam.getTeamName() + ": "+ "\t" + newTeam.getBatAvgStr() + " " + newTeam.getSlugAvgStr());
my output:
2011 Regular Season
TEAM BA SA
Boston: .280 .461
NY_Yankees: .263 .444
Texas: .283 .460
Detroit: .277 .434
St.Louis: .273 .425
Toronto: .249 .413
Cincinnati: .256 .408
Colorado: .258 .410
Arizona: .250 .413
Kansas_City: .275 .415