Вопрос

Is there any way to make text vertically be aligned text Hello World! to middle of table cell without splitting into two cells?

<table border="1">
    <tr>
        <td valign="middle" style="vertical-align:middle;">
            Hello World! <img src="https://www.google.com/images/srpr/logo3w.png" border="1" />
        </td>
    </tr>
</table>

http://jsfiddle.net/U4Qs4/

Это было полезно?

Решение

You need to vertically align the image, not the td element.

Другие советы

Works in Chrome FF and IE7 ....

<style>
.mid {
    vertical-align:middle
    }
</style>


<table border="1">
    <tr>
        <td class="mid">
            <img src="https://www.google.com/images/srpr/logo3w.png" class="mid" border="1" />Hello World!
        </td>
    </tr>
</table>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top