我在同一块上有两种形式。我想在它后面放一张桌子,但是它没有放在新的一行上并坚持使用第二种形式。 See picture,在图片中您可以看到最后一个显示为Cry和Lite ...的元素,也就是没有换行的表格。我有以下代码:-
<div style="display: flex;">
<form name="myform" method="post" action="usdbtc.php" style="float:left;">
<div id="log_err"> <strong>
<?php if(isset($eroor)) { echo $eroor; } ?>
<?php if(isset($tm)) { echo $tm; } ?>
<?php if(isset($tah)) { echo $tah; } ?>
<?php if($au == 1) { echo 'Please log in to trade.';} ?></strong> </div>
<p><label style="float: left;">Price:</label><input class="input101" style="float: left;" type="text" name="uprice"
id="box1" oninput="calculate()"><label style="float: right;">:
<?php echo $market; ?></label><input class="input101" style="float: right;" type="text" name="uam" id="box2" oninput="calculate()">
<br><input class="input101" style="float: right;" type="text" name="utam" id="result"><br><label style="padding: 10px;">Total
<?php echo $bm; ?>:</label>
<td rowspan="2">
<input type="hidden" name="myform" value="1">
<br><span class="orderbutton" type="submit" id="ordersell" onclick="myform.submit()">SELL</span></p>
</td>
</form>
<form name="yourform" method="post" action="usdbtc.php" style="float:right;">
<div id="log_err"> <strong>
<?php if(isset($eroor)) { echo $eroor; } ?>
<?php if($au == 1) { echo 'Please log in to trade.';} ?></strong> </div>
<p><label style="float: left;">Price:</label><input class="input101" style="float: left;" type="text" name="username"
id="box3" oninput="calculate()"><label style="float: right;">:
<?php echo $market; ?></label><input class="input101" style="float: right;" type="text" name="username" id="box4" oninput="calculate()">
<br><input class="input101" style="float: right;" type="text" name="username" id="resul"><br><label style="padding: 10px;">Total
<?php echo $bm; ?>:</label>
<td rowspan="2">
<input type="hidden" name="yourform" value="1">
<br>
<span class="orderbutton" type="submit" id="orderbuy" onclick="yourform.submit()">BUY</span></p>
</td>
</form>
<div class="abcd">
<div class="panel-body">
<div class="data-table">
<table class="table table-striped table-bordered table-hover" id="btcaddresses">
<thead>
<tr>
<th>Crypto</th>
</thead>
<tbody>
<tr>
<td>
<img src="images/Mltc.png" width="20" height="20" style="margin-right: 5px; ">Litecoin</td>
</tr>
</tr>
</tbody>
</table>
</div>
更新
我自己发现了错误。除以style =“ display:flex在表之后结束,导致问题刚移出</div>
,最后移到第二</form>
答案 0 :(得分:2)
您的HTML非常糟糕,对此我感到抱歉。标签未正确关闭,有些标签甚至未关闭。表格在HTML中表现得很有趣,如果不关闭它们,则非表格标签会显示在表格上方。我已修复您的HTML,它应该对您来说更好。
<div style="display: flex;">
<form name="myform" method="post" action="usdbtc.php" style="float:left;">
<div id="log_err"> <strong><?php if(isset($eroor)) { echo $eroor; } ?><?php if(isset($tm)) { echo $tm; } ?><?php if(isset($tah)) { echo $tah; } ?><?php if($au == 1) { echo 'Please log in to trade.';} ?></strong> </div>
<p>
<label style="float: left;">Price:</label>
<input class="input101" style="float: left;" type="text" name="uprice" id="box1" oninput="calculate()">
<label style="float: right;">: <?php echo $market; ?></label>
<input class="input101" style="float: right;" type="text" name="uam" id="box2" oninput="calculate()"><br>
<input class="input101" style="float: right;" type="text" name="utam" id="result"><br><label style="padding: 10px;">Total <?php echo $bm; ?>:</label>
<td rowspan="2">
<input type="hidden" name="myform" value="1">
<br>
<span class="orderbutton" type="submit" id="ordersell" onclick="myform.submit()">SELL</span>
</td>
</p>
</form>
<form name="yourform" method="post" action="usdbtc.php" style="float:right;">
<div id="log_err">
<strong><?php if(isset($eroor)) { echo $eroor; } ?><?php if($au == 1) { echo 'Please log in to trade.';} ?></strong>
</div>
<p>
<label style="float: left;">Price:</label>
<input class="input101" style="float: left;" type="text" name="username" id="box3" oninput="calculate()">
<label style="float: right;">: <?php echo $market; ?></label>
<input class="input101" style="float: right;" type="text" name="username" id="box4" oninput="calculate()"><br>
<input class="input101" style="float: right;" type="text" name="username" id="resul"><br>
<label style="padding: 10px;">Total <?php echo $bm; ?>:</label>
<td rowspan="2">
<input type="hidden" name="yourform" value="1">
<br>
<span class="orderbutton" type="submit" id="orderbuy" onclick="yourform.submit()">BUY</span>
</td>
</p>
</form>
<div class="abcd"></div>
<div class="panel-body">
<div class="data-table">
<table class="table table-striped table-bordered table-hover" id="btcaddresses">
<thead>
<tr>
<th>Crypto</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<img src="images/Mltc.png" width="20" height="20" style="margin-right: 5px; ">
Litecoin
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>