Skip to content Skip to sidebar Skip to footer

Error Css: Vertical Align In Td With Input Text And Image

I have a table with a cell with 2 items (input text and image). I try to align them vertically but it does not work. I try use vertical-align:middle, margin top, padding, try set h

Solution 1:

Add vertical-align: middle to .campoOpcional input and it works - see demo below:

.campoOpcional input {
  vertical-align: middle;
}
<table cellspacing="0" rules="all" border="1" id="Origen" style="width:100%;border-collapse:collapse;">
  <tr>
    <td class="cabeceraDG">Origen</td>
    <td class="cabeceraDG">Centro</td>
    <td class="cabeceraDG">Usuario</td>
  </tr>
  <tr style="white-space:nowrap;">
    <td class="campoOpcional">oficina</td>
    <td class="campoOpcional" align="center" style="width:150px;">
      <input name="Origen$ctl02$referenciaTextBox" type="text" value="0000" id="Origen_ctl02_referenciaTextBox" class="campoOpcional" onblur="return validate(this)" ref="0991" />
      <input type="image" name="Origen$ctl02$imgBtnGuardarCentro" id="Origen_ctl02_imgBtnGuardarCentro" title="Guardar" AutoPostBack="false" src="https://s30.postimg.org/usmf6nsn5/boton_Abonar.gif" onclick="return ASPxClientEdit.ValidateGroup();  msGuardar();"
      style="border-width:0px;" />
    </td>
    <td class="campoOpcional">TEST</td>
  </tr>
</table>

Solution 2:

Use this code,

input inside the campoOpcional needed vertical-align

.campoOpcional input {
  vertical-align: middle;
}

Post a Comment for "Error Css: Vertical Align In Td With Input Text And Image"