user2815059 user2815059 - 2 months ago 13
HTML Question

How to remove extra space inside textarea

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

Answer

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.

Comments