给定1页上的2个表单,我希望表单#2中的某些元素与表单#1中的某些元素并排。还未能弄清楚这一点,因为表格2中的元素总是落在表格1的末尾。我还需要保持表格2元素结构完好无损,因为它来自外部库。

<form name="form1">
    <textarea rows="10" name="tabTxBx" id="tabTxtArea" cols="50" wrap="off" ></textarea><br><br>
    Captcha image here<br>
    Type capture image:<br>
    <input type="text"><br><br>
</form>
<table width="400">
    <tr>
        <td width="200">
               <input type="submit" value="  save  ">
        </td>
        <td>
            <!-- BEGIN: Can't alter this structure -->
            <form name='form2' method="POST" action="" onSubmit="return submitPlay();" target="sndWin">
                I want this right aligned under the textarea
                <input type="text" size="55" value="I want this right aligned under the textarea">
                <input type="button" value="I want this right aligned under the textarea">
            </form>
           <!-- END: Can't alter this structure -->
        </td>
    </tr>
</table>


另请注意:
我无法分解表格2,并且需要暂时避免使用HTML5功能(以支持较旧的浏览器)。

JS小提琴:

http://jsfiddle.net/z562wx2c/5/

最佳答案

您可以使用css更改表单显示,并将第二个表单拖动到相对位置的第一个表单中。我在这里更新了您的小提琴:http://jsfiddle.net/z562wx2c/8/

样式请Stackoverflows请看代码:

.relative {
    position: relative;
    width: 200px;
    bottom: 105px;
    left: 170px;
}


像那样?

您可能想对文本区域使用正常的高度和宽度,因为像firefox这样的“现代”浏览器在cols和row方面存在严重问题。

10-05 20:36
查看更多