Issue 11833-2
updated the to_string() function of DataFrameFormatter(TableFormatter) class ,in format.py file, of the core directory.This is another commit . I hope this works
#11833

@jreback,  sir the issue was to remove the leading white spaces, which the commit does.
Yet the tests fail, because the leading white spaces are required for the assertion.

https://github.com/pydata/pandas/issues/11833
 You already have an identical PR #11903, you can work further with that one.
