[英]Align inputs in different td horizontally
I am trying to align 2 inputs in 2 different td
tag to align horizontally.我正在尝试对齐 2 个不同
td
标签中的 2 个输入以水平对齐。 Moreover, when input
has been appended into td
, it will cover the td
text此外,当
input
被附加到td
时,它将覆盖td
文本
There are 2 cases:有2种情况:
td
have text or empty, then everything is OK.td
都有文本或为空时,一切正常。td
has text, they do not align on same linetd
之一有文本时,它们不会在同一行对齐This is my source code I have tried: https://jsfiddle.net/oc8Lgm3y/2/这是我尝试过的源代码: https://jsfiddle.net/oc8Lgm3y/2/
you can add vertical-align:bottom;
您可以添加
vertical-align:bottom;
to the td,th
.到
td,th
。
You can check the source code here: https://jsfiddle.net/k1gapfmq/你可以在这里查看源代码: 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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.