The following tutorial with code can be used to display the contents from the database into the HTML or PHP pages with formatting like 'ENTER' or 'TAB'. It will preserve the formatting as it is typed in the text area.
1. Add the following property to the textarea<textarea name="tarea"
WRAP="virtual"></textarea>
2. Add the following code where the contents from the MySQL database is retrieved and displayed :
<?php
$string = str_replace("\r\n", "<br>", $string);
$string = str_replace("\n\r", "<br>", $string);
$string = str_replace("\r", "<br>", $string);
$string = str_replace("\n", "<br>", $string);
print("$string");
?>