How to put TextArea inside td table?

I want to place textareainside the table td. Unfortunately, it remains single-line.

<td align="right" valign="top"> </td>
<td>
    <input type="textarea" rows="10" cols="45" name="push_title" />
</td>

If I set its width and height statically, it resizes, but still remains single-line in the middle. How can I solve this problem?

+4
source share
1 answer

Use an element instead <textarea>. Thus:

<td align="right" valign="top"> </td>
<td>
    <textarea name="" id="" cols="45" rows="10"></textarea>
</td>

Just for example:

table tr td {
    border: 1px solid #ccc;
}
<table style="width:100%" cellborder="1">
    <tr>
        <td align="right" valign="top"> </td>
        <td>
            <textarea name="" id="" cols="45" rows="10"></textarea>
        </td>
        <td>50</td>
    </tr>
    <tr>
        <td>Eve</td>
        <td>Jackson</td>
        <td>94</td>
    </tr>
</table>
Run codeHide result

Hope this helps !!!

+10
source

Source: https://habr.com/ru/post/1615609/


All Articles