Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line breaks in textarea element

This is PURE HTML. (no php or anything like that, if you want to know the background its a C# application with HTML in a web view).

All my HTML files are nicely formatted and correctly indented for maintainability and such.

Here is an excerpt:

<tr>     <td class="label">Clinic Times:</td>     <td><textarea name="familyPlanningClinicSessionsClinicTimes">Monday:     Tuesday:     Wednesday:     Thursday:     Friday:     Saturday:     Sunday:</textarea></td> </tr> 

The line breaks in the <textarea></textarea> element are there to get the line breaks on the page. However it also includes the indentation in the textarea element.

e.g.

example

The only way I can think to remove this issue is to remove the indentation. Its not the end of the world, but is there another way, to keep the nice formatting? Thanks.

like image 418
Thomas Clayson Avatar asked Nov 02 '11 14:11

Thomas Clayson


1 Answers

You could use the &#10; (it means new line in html) but maybe that's not a nice formatting, like you said...

The only way I can think to remove this issue is to remove the indentation. Its not the end of the world, but is there another way, to keep the nice formatting?

<tr>   <td class="label">Clinic Times:</td>   <td><textarea name="familyPlanningClinicSessionsClinicTimes">Monday:&#10;Tuesday:&#10;Wednesday:&#10;Thursday:&#10;Friday:&#10;Saturday:&#10;Sunday:</textarea></td> </tr> 
like image 71
Marcx Avatar answered Sep 20 '22 03:09

Marcx