我的数据表工作正常,在我的行动'列我正在显示图像供用户编辑/删除等。
然而,图像非常接近,我如何在它们之间放置几个空格?
我使用以下代码显示图像;
$row[2] = "
<td><a onClick =\"return confirm('Are You Sure You Want To Edit This Ticket?')\" href=$edit>
<img src=\"edit.png\">
<td><a onClick =\"return confirm('Are You Sure You Want To Delete This Ticket?')\" href=$delete>
<img src=\"delete.png\">";
请告诉我如何在两者之间留一个空间?
由于
答案 0 :(得分:1)
使用层叠样式表(CSS)可以改变HTML元素的外观。
例如:
<style type="text/css">
.spaced {
display: inline-block;
margin: 0px 5px 0px 5px;
}
</style>
$row[2] = "<td><a class=\"spaced\" onClick =\"return confirm('Are You Sure You Want To Edit This Ticket?')\" href=$edit><img src=\"edit.png\"><td><a onClick =\"return confirm('Are You Sure You Want To Delete This Ticket?')\" href=$delete><img src=\"delete.png\">";
答案 1 :(得分:0)
您可以尝试添加
图片之间
。这个例子我添加了3个空格。
答案 2 :(得分:0)
$row[2] = "<td><a onClick =\"return confirm('Are You Sure You Want To Edit This Ticket?')\" href=$edit><img src=\"edit.png\"><td><a onClick =\"return confirm('Are You Sure You Want To Delete This Ticket?')\" href=$delete><img src=\"delete.png\" style="padding:5px;">";
试试这个