Bad formating in text file display

I’m trying to display a text file on a call back.Its getting displayed but its formatting is changed.The spacing is very bad.But if i copy that same text and paste it in notepad its displaying properly.

html.Div(id=‘display-testrundata’, style={‘color’: colors[‘text’], ‘fontSize’: 16, ‘font-family’: “Lucida Sans Unicode”, ‘whiteSpace’: ‘pre-wrap’, ‘wordBreak’: ‘break-all’})

@app.callback(Output(‘display-testrundata’, ‘children’),
[Input(‘dropdown’, ‘value’),Input(‘date-picker-single’, ‘date’)])
def display_testrun(dropdown_value,displaydate):
with open(dropdown_value) as f:
displaytestrundata =
#Below lines also give bad formating
#displaytestrun =, ‘r’, “utf-8”)
#displaytestrundata =
#displaytestrundata = ‘\n’.join(displaytestrundata)
return displaytestrundata

This is how its displayed on my dash:

This is how its displaying if i copy same content onto a text file:

Your console font is not monospace.


@Philippe Thanks you very much again.It worked after i changed the font family to monospace.