简体   繁体   中英

Align inputs in different td horizontally

I am trying to align 2 inputs in 2 different td tag to align horizontally. Moreover, when input has been appended into td , it will cover the td text

在此处输入图像描述

There are 2 cases:

  • When both of td have text or empty, then everything is OK.
  • When one of the 2 td has text, they do not align on same line

This is my source code I have tried: https://jsfiddle.net/oc8Lgm3y/2/

you can add vertical-align:bottom; to the td,th .

You can check the source code here: https://jsfiddle.net/k1gapfmq/

table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 50%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  vertical-align: bottom;
  padding: 8px;
}

input[name=^='product'] {
  background-color: red;
}

html表格

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM