<html>
<head>
<style type="text/css">
#text {
height:20px;
vertical-align:middle;
line-height:20px; /*line-height must be equal to height*/
}
</style>
</head>
<body>
<table>
<input type="text" id="text">
</table>
</body>
</html>
转载于:https://www.cnblogs.com/njl041x/p/3920188.html