如何避免HTML表格造成空白 [英] How to avoid white space due to HTML Table

查看:600
本文介绍了如何避免HTML表格造成空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

当我使用HTML时,每个单元格下面都有一个空格...如何避免这种情况?确保没有< br>,& nbsp和单元格间距/填充......
例如,如果我将一个控件放置在单元格中,则该控件适合单元格的顶部,并在其下方留出一些空白...
如何避免这种情况?

在此先感谢

Hi there,

When I use HTML I get a white space under each cell...How to avoid this?It''s sure that no <br>,&nbsp and Cell Spacing/Padding are there...
For example if I place a control inside the cell the control fit into the top of the cell and leaving some white space under it...
How to avoid this?

Thanks in advance

推荐答案

亲爱的朋友
将表格标签的cellpadding cellspacing边框属性设置为0

< table cellpadding ="0" cellspacing ="0" border ="0">
这样可以解决问题
Dear Friend
set cellpadding cellspacing border attributes of table tag to 0
ie
<table cellpadding="0" cellspacing="0" border="0">
this will solve the issue


使用CSS:

Use CSS:

td { padding: 0;}



有关各方面的详细控制,请使用:



For detailed control on each side, use:

td {
   padding-left: 1em;
   padding-right: 2em;
   padding-top: 0.3em;
   padding-bottom: 10em; }



对于不同类型的不同设置,请使用类:



For different settings for different types, use classes:

td.leftmost { /*...*/ }


HTML:


HTML:

<td> class="leftmost"</td>



—SA



—SA


这篇关于如何避免HTML表格造成空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆