Alfred
Alfred

Reputation: 21406

Set text to appear on the top, in a large table cell

I have a table like this;

HTML

<table>
    <tr>
        <td>mytext</td>
    </tr>
</table>

CSS

table tr td{
    height: 100px;
    width: 200px;
    border: solid 1px #000;
}

which look like this;

enter image description here

But I want the text to start at the beginning of the box, like;

Expected

How can I achieve this? Here is the working fiddle.

Upvotes: 0

Views: 134

Answers (3)

Praveen Dabral
Praveen Dabral

Reputation: 2509

Use below code in your css.

table tr td{vertical-align: top;}

Upvotes: 0

DevelopmentIsMyPassion
DevelopmentIsMyPassion

Reputation: 3591

Just use vertical-align: top

Update fiddle here here

Upvotes: 0

user1467267
user1467267

Reputation:

Here's the answer:

http://jsfiddle.net/VSZZJ/2/

table tr td{
    height: 100px;
    width: 200px;
    border: solid 1px #000;
    vertical-align: top;
}

Upvotes: 3

Related Questions