# Problem with html.Iframe

**URL:** <https://community.plotly.com/t/problem-with-html-iframe/23165>\
**Category:** Dash Python\
**Created:** [May 7, 2019, 2:33pm UTC](https://community.plotly.com/t/problem-with-html-iframe/23165 "2019-05-07T14:33:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paichui](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@Paichui](https://community.plotly.com/u/Paichui)\
**Post date:** [May 7, 2019, 2:33pm UTC](https://community.plotly.com/t/problem-with-html-iframe/23165/1 "2019-05-07T14:33:45Z")

</div>

I am trying to load and print all the console output into Dash. Tried Markdown first but not working well. Then I used html.Iframe. The place where I got stuck is it is not showing the white-space of the tables in the text file. For example below:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/6/6f5ee3012a0ad53dec8fbcdf2abf7474d64437c1.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/3/30027a45a5faf495d5a1545a10f116284efe84a8.png)

Here is my code:

the ‘white-space’:’ pre-wrap’ seems not working to do the job. I am curious how I can fix this or if there is a better way to show this txt. Thanks

import dash  
import dash\_core\_components as dcc  
import dash\_html\_components as html

text\_markdown = “”  
f = open(‘stdout.txt’)  
line = f.readline()  
text\_markdown = “”  
while line:  
text\_markdown += “  
”+line  
line = f.readline()  
f.close()

app = dash.Dash( **name** )

app.layout = html.Div([  
html.Div([

# dcc.Markdown(text\_markdown)

```
                       html.Iframe(

                               srcDoc = text_markdown,
                               style={'border': 'none', 'width': '100%', 'height': 600,'white-space':' pre-wrap'},)
            ])

```

])

if **name** == ‘ **main** ’:  
app.run\_server(debug=False)

Here is a sample text file:

Processing 3/9 : AC857-1\_LQC\_IRM.las  
The file has these tracks: [‘DEN’, ‘DT’, ‘DT\_SHEAR’, ‘GR’, ‘NET\_SAND\_LRP’, ‘NEU’, ‘POR\_LRP’, ‘POR\_SAND\_LRP’, ‘RES\_DEP’, ‘SWT\_LRP’, ‘SWT\_SAND\_LRP’]  
Well Log Detection Mode:  
| Log Name | Value Looks | Fuzzy Search |  
|------------------±--------------±---------------|  
| [‘DEN’] | [‘DEN’] | [‘DEN’] |  
| [‘DT’] | [‘DTC’] | [‘DTC’] |  
| [‘DT\_SHEAR’] | [‘DTS’] | [‘DTS’] |  
| [‘GR’] | [‘GR’] | [‘GR’] |  
| [‘NET\_SAND\_LRP’] | [‘POR’] | [‘NTG’] |  
| [‘NEU’] | [‘POR’] | [‘NEU’] |  
| [‘POR\_LRP’] | [‘POR’] | [‘POR’] |  
| [‘POR\_SAND\_LRP’] | [‘POR’] | [‘POR’] |  
| [‘RES\_DEP’] | [‘RT’] | [‘RT’] |  
| [‘SWT\_LRP’] | [‘FRAC’] | [‘SW’] |  
| [‘SWT\_SAND\_LRP’] | [‘FRAC’] | [‘SW’] |

---

<div class="post-metadata">

**Author:** ![Paichui](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@Paichui](https://community.plotly.com/u/Paichui)\
**Post date:** [May 7, 2019, 7:07pm UTC](https://community.plotly.com/t/problem-with-html-iframe/23165/2 "2019-05-07T19:07:58Z")

</div>

Problem was solved by switching to dcc.Textarea
