kxk
kxk

Reputation: 596

CSS: Align a textarea inside a td

it's one of those usual table-related questions. I am trying to bloody align a textarea to be centered in a table element. It just won't work... I feel like I have tried everything...

Do you need a sample code for something like this? Just imagine this:

<table>
<td><textarea></textarea></td>
</table>

The task is to align the textarea in the center of this td.

Upvotes: 2

Views: 6134

Answers (4)

varsha desai
varsha desai

Reputation: 21

set height and line-height properties. style="width: 100%;height:885px; font-family: Sans-Serif; font-size: 11px; line-height:22px; overflow: hidden; padding: 0px; margin: 0px;"

Upvotes: 0

Subdigger
Subdigger

Reputation: 2193

css

textarea {
    width: 300px;
    height: 200px;
    margin: 0 auto;
    display: block;
}

Upvotes: 5

Ian Oxley
Ian Oxley

Reputation: 11056

This should do the trick:

td {
    text-align:center;
}

Upvotes: 2

dknaack
dknaack

Reputation: 60496

only centered ?

<table>
<td valign="middle" align="center"><textarea></textarea></td>
</table>

or do you want fill the whole td ?

Upvotes: 3

Related Questions