Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在表格中内联显示文本和图像输入_Html_Css_Input - Fatal编程技术网

Html 在表格中内联显示文本和图像输入

Html 在表格中内联显示文本和图像输入,html,css,input,Html,Css,Input,您好,我想在表格中显示文本和图像输入,如下所示: 我尝试过以下代码: <tbody> <tr> <td class="inputs"> <input type="text" id="input1" size="3"/> </td>

您好,我想在表格中显示文本和图像输入,如下所示:

我尝试过以下代码:

<tbody>
            <tr>
                <td class="inputs">
                    <input type="text" id="input1" size="3"/>
                </td>
                <td class="inputs">
                    <input type="text" id="input2" />
                </td>
                <td class="inputs">
                    <input type="text" id="input3" size="10"/>
                </td>
                <td class="inputs">
                    <input type="text" id="input4" size="8"/>
                    <input type="image" src="button.png" />
                </td>
                <td class="inputs">
                    <input type="text" id="input5" size="10"/>
                </td>
                <td class="inputs">
                    <input type="checkbox" id="input6" />
                </td>
            </tr>

但结果是:


有没有办法解决这个问题?请帮忙

这里的问题是垂直对齐。只需在表格单元格中的
输入
元素上指定
垂直对齐:顶部
,它们将全部对齐到相同的位置(在本例中为顶部):

td输入{
垂直对齐:顶部;
}

您应该尝试为输入元素设置相同的
行高
(如果需要
显示:内联块
,也要检查)