gpt4 book ai didi

表格中按钮之间的 HTML 空间

转载 作者:太空宇宙 更新时间:2023-11-04 03:09:17 30 4
gpt4 key购买 nike

我创建了一个表,其中每行包含两个按钮,并且两个按钮连接在一起,我想将两个按钮分开。我用过 不起作用,css 也是,这是他们的另一种方式。

我有另一个问题,因为我不想在表格边框内显示操作按钮,而是在靠近表格的地方显示。

<table style="border:2px solid white; cellpadding=10 cellspacing=0">
<tr style="background:#00B050;color:#fff;">

<th>Name</th>
<th>Image</th>
<th>Description</th>
<th>Contact Renter</th>
<th>Rent price</th>
<th>Action</th>
</tr>

<?php
while($row = mysql_fetch_array($result)) {
?>
<tr>
<td><?php echo $row['productname'];?></td>
<td><img src='./images/products/<?php echo $row["productimage"];?>' width='150' height='100' alt=''></td>
<td><?php echo $row['productdescription'];?></td>
<td><?php echo $row['rentersdetails'];?></td>
<td><?php echo $row['rentprice'];?></td>
<td>
<input class="button_normal" type="button" value="Find Renter" onclick="window.open('https://www.google.co.uk/maps/')"/>
<input class="button_normal" type="button" value="Mail Renter" onclick="window.open('mailto:')"/>
</td>
</tr>
<?php

最佳答案

好的,如果我理解正确的话,您希望按钮位于表格的“外部”。您可以通过定位最后一个 thtd 并删除边框和背景颜色(只是隐藏 th)来实现这一点。它仍会在表格中,但看起来不会像那样。

在下面经过编辑的片段中,您可以看到我添加了一些内联样式。最好使用外部样式表,因此请确保以正确的 thinput 为目标!查看:nth-child() -选择器作为可能的解决方案。

<table style="border:2px solid white; cellpadding=10 cellspacing=0">
<tr style="background:#00B050;color:#fff;">

<th>Name</th>
<th>Image</th>
<th>Description</th>
<th>Contact Renter</th>
<th>Rent price</th>
<th style="display:none">Action</th>
</tr>

<?php
while($row = mysql_fetch_array($result)) {
?>
<tr>
<td><?php echo $row['productname'];?></td>
<td><img src='./images/products/<?php echo $row["productimage"];?>' width='150' height='100' alt=''></td>
<td><?php echo $row['productdescription'];?></td>
<td><?php echo $row['rentersdetails'];?></td>
<td><?php echo $row['rentprice'];?></td>
<td style="min-width:200px">
<input class="button_normal" type="button" value="Find Renter" onclick="window.open('https://www.google.co.uk/maps/')"/>
<input style="margin-left:20px" class="button_normal" type="button" value="Mail Renter" onclick="window.open('mailto:')"/>
</td>
</tr>
<?php

这一切都是用非常基本的 CSS 解决的,所以如果你对此有困难,我会认真考虑在线学习一些 CSS 教程!

关于表格中按钮之间的 HTML 空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29849473/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com