Forum Moderators: open

Message Too Old, No Replies

Vertically Center Align Text Field in Table

         

jhaski

10:29 pm on Jun 8, 2009 (gmt 0)

10+ Year Member


How do I vertically center align the text field in a table. Currently, the text field goes to the very top of the table column, and I can't figure out how to center it.

<code>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="B33A00" valign="bottom" align="center">
<form method="POST" action="search.php">
<input type="hidden" name="posted" value="1">
<input type="hidden" name="sprice" value="">
<INPUT type="text" id="search" name="field-keywords" size="40" style="width:70&percnt;" value="Search entire store..." onclick="javascript:this.value=''" />
<input name="submit" type="submit" value="Search">
</form>
</td>




<td bgcolor="B33A00"> <span id="title">Sample Text</td>

</tr>

</table>

</code>

tedster

3:12 am on Jun 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to use valign="middle" or the css rule "vertical-align:middle;" for the table cell involved.