Search code examples
htmlcsshtml-tablevertical-alignment

Vertical align in tables?


I'm having an object in a table and I'm unable to set vertical align (it doesn't seem to work).

Why is that?

Example:

http://jsfiddle.net/PHDWz/1/


Solution

  • When I give the td a height.. the content is vertical aligned in the middle....

    <table cellspacing="0">
        <thead>
            <tr>
                <th scope="col" style="width: 180px">Description</th>
                <th scope="col">Textarea</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td height="400">Bla bla bla! Write something if you like! </td>
                <td>
                    <textarea></textarea>  <span><img src="http://www.qualtrics.com/university/wp-content/plugins/wp-print/images/printer_famfamfam.gif" alt="printer"> A printer!</span>
                </td>
        </tbody>
    </table>