Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove extra space inside textarea

Tags:

I have a textarea which displays some data from "history" column in my database. For unknown reason there is nearly 1.5 line of extra space before the text. Anyone can give me some idea why does it happen? Here is my HTML piece:

<div>   <table>     <tr>       <th > History:</th>       <td>         <textarea style="margin-left:90px";  name="history"cols="80"label="notes"rows="4"wrap="virtual">          <?php echo $my_class->history;?></textarea>       </td>      </tr>   </table> </div> 

You can see the problem here:enter image description here

like image 443
user2815059 Avatar asked Jun 23 '14 14:06

user2815059


People also ask

How can I remove extra space from textarea?

Just put your php open tag right after the textarea close tag.. Dont use line break.. And close php exactly before (as you have done).. This will erase all the whitespaces..

How do I wrap text in textarea in HTML?

The HTML textarea wrap Attribute is used to specify that in which manner the text is to be wrapped in a text area when a form is submitted. Attribute Values: soft: It specifies that the Text present in the Textarea would not be wrapped after submitting the form. This is the default value.

Is textarea editable?

By default, a textarea is editable. So you must have made something that make it uneditable.

How do I increase the width of a textarea in HTML?

You need to define width of the div containing the textarea and when you declare textarea , you can then set . main > textarea to have width: inherit . Note: .


2 Answers

Its because your php tag is on a newline. It is reading in the whitespace from where <textarea> ends until php tag opens. Put this all on one line to fix.

like image 189
Revive Avatar answered Oct 20 '22 16:10

Revive


Just put your php open tag right after the textarea close tag.. Dont use line break.. And close php exactly before (as you have done).. This will erase all the whitespaces..

like image 26
Giorgos Tsakonas Avatar answered Oct 20 '22 16:10

Giorgos Tsakonas