gpt4 book ai didi

html - 删除表格中两行小按钮之间的空间

转载 作者:太空宇宙 更新时间:2023-11-04 06:39:21 24 4
gpt4 key购买 nike

当我使用大小超过 ~25px 的按钮并且行与行之间没有空格时,我发现的所有解决方案都有帮助。但是,当我尝试使用尺寸较小(如 18 像素)的按钮时,行之间会出现空格。到目前为止,只有 margin: -px 帮助我减少了一些空间。

<table cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; border-spacing: 0; display: block;">
<tr style="padding: 0;">
<td style="padding: 0;">
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
</td>
</tr>
<tr style="padding: 0;">
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
</tr>
<tr style="padding: 0;">
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
</tr>
<tr style="padding: 0;">
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
</tr>
</table>

screen

最佳答案

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">


<title>Untitled</title>
<style>td {line-height: 18px;}</style>

</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; border-spacing: 0; display: block;">
<tr style="padding: 0;">
<td style="padding: 0;">
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
</td>
</tr>
<tr style="padding: 0;">
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
</tr>
<tr style="padding: 0;">
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
</tr>
<tr style="padding: 0;">
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
<td style="padding: 0;">
<button style="background-color:blue; width: 18px; height: 18px; border: 0; margin-top: -16px; margin-bottom: -16px; font-size: 0pt;" />
</td>
</tr>
</table>
</body>
</html>

关于html - 删除表格中两行小按钮之间的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53939955/

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