peat wedty peat wedty - 6 months ago 16
HTML Question

How to display data on top of <td> tag inner table?

How to display data on top of tag inner table ?

By below code, When load page it,s will be show like this image.

http://image.free.in.th/v/2013/ir/160521040137.png

But i want to show

111
on top of
<td>
tag, like this image.

http://image.free.in.th/v/2013/io/160521040244.png

How can i do that ? , I tried every thing but not work.

<table>
<tbody>
<tr>
<td style="width: 100px;-ms-word-wrap: break-word;word-wrap: break-word;-ms-word-break: break-word;word-break: break-word;word-break: break-all;padding-left: 10px;border: 1px solid #d0d0d0;text-align: center;">111</td>
<td style="width: 600px; -ms-word-wrap: break-word; word-wrap: break-word; -ms-word-break: break-word; word-break: break-word; word-break: break-all; padding-left: 10px; border: 1px solid #d0d0d0; ">
dsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdfdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdfdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdf
</td>
</tr>
<tr>
<td style="width: 100px;-ms-word-wrap: break-word;word-wrap: break-word;-ms-word-break: break-word;word-break: break-word;word-break: break-all;padding-left: 10px;border: 1px solid #d0d0d0;text-align: center;">222</td>
<td style="width: 600px; -ms-word-wrap: break-word; word-wrap: break-word; -ms-word-break: break-word; word-break: break-word; word-break: break-all; padding-left: 10px; border: 1px solid #d0d0d0; ">
dsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdhgdffdsgfdh
</td>
</tr>
</tbody>
</table>

Answer

Add a vertical-align:top; and you're good to go.

Here's a fiddle with this addition.

Edit: Put those inline code inside a class and use it!