How to show newlines from textarea in a table?

Gnark picture Gnark · Sep 24, 2009 · Viewed 11.8k times · Source

In a form I have a textarea where obviously text is entered. When the input is finished the content gets submitted to the server and is being stored in a database...

When I display the input the user made within a table, the newlines are not visible. When I inspect the source the newlines are there, but within a table the newlines do not work...

Is there any possibility of displaying the linebreaks within that table? I know, probably a really silly question but I'm not to pro when it comes to things like html and css...

Any help is really appreciated!

Answer

vsync picture vsync · Apr 6, 2014

Set your css in the table cell to

white-space:pre-wrap;