2012-03-08 223 views
0

我一直在使用这张表,现在一下子突然中断了。我有我的文件中的CSS,但无论出于何种原因,它现在在表格图像发布之后在表格行的底部添加空行。它甚至可以在没有CSS的同一张表上执行此操作。我尝试过桌高,间距,作品。我无法弄清楚为什么这里有一个空白的行。我很抱歉,如果它证明我是一个愚蠢的修复程序,我已经搜索并尝试了很多修复程序。HTML Table在一行的底部添加空格。 [HTML]

HERE IS AN EXAMPLE

<table border="1"> 
     <tr> 
     <td></td> 

     <td> 
      <form action="" method="post"> 
      <div> 
       <input type="hidden" name="id" value="" /> 
       <input type="hidden" name="d" value="1" /> 
       <input type="image" src="../resources/img/direction/up_arrow.png" alt="Up" width="62" height="62" /> 
      </div> 
      </form> 
     </td> 

     <td></td> 
     </tr> 

     <tr> 
     <td> 
      <form action="" method="post"> 
      <div> 
       <input type="hidden" name="id" value="" /> 
       <input type="hidden" name="d" value="2" /> 
       <input type="image" src="../resources/img/direction/left_arrow.png" alt="Left" width="62" height="62" /> 
      </div> 
      </form> 
     </td> 

     <td> 
      <form action="" method="post"> 
      <div> 
       <input type="hidden" name="id" value="" /> 
       <input type="hidden" name="r" value="1" /> 
       <input type="image" src="../resources/img/direction/rest_button.png" alt="Rest" width="62" height="62" /> 
      </div> 
      </form> 
     </td> 

     <td> 
      <form action="" method="post"> 
      <div> 
       <input type="hidden" name="id" value="" /> 
       <input type="hidden" name="d" value="3" /> 
       <input type="image" src="../resources/img/direction/right_arrow.png" alt="Right" width="62" height="62" /> 
      </div> 
      </form> 
     </td> 
     </tr> 

     <tr> 
     <td></td> 

     <td> 
      <form action="" method="post"> 
      <div> 
       <input type="hidden" name="id" value="" /> 
       <input type="hidden" name="d" value="4" /> 
       <input type="image" src="../resources/img/direction/down_arrow.png" alt="Down" width="62" height="62" /> 
      </div> 
      </form> 
     </td> 

     <td></td> 
     </tr> 
    </table> 
+0

你的代码是否自行破解,或者你的意思是在特定的浏览器中? – 2012-03-08 07:35:54

回答

1

tdform s有一定的余量。添加以下css:

form { 
    margin: 0; 
} 

要防止更多此类行为,您应该包括改为normalize.css

+0

谢谢你的帮助,我把头发拉出来。我也使用这个技巧,谢谢! – 2012-03-08 08:04:30

0

这个CSS是什么将解决你的问题:

form {margin:0;padding:0} 

额外的空间已基本从表单来的。你可能从css中删除了一些旧代码,这就是为什么它突然崩溃。

+0

你最有可能的权利,我可能做了某个地方。 – 2012-03-08 08:04:50