Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从HTML表中完全删除边框_Html_Css_Html Table_Background Image - Fatal编程技术网

如何从HTML表中完全删除边框

如何从HTML表中完全删除边框,html,css,html-table,background-image,Html,Css,Html Table,Background Image,我的目标是制作一个类似于“相框”的HTML页面。换句话说,我想做一个空白的页面,周围有4张图片 这是我的代码: <table> <tr> <td class="bTop" colspan="3"> </td> </tr> <tr> <td class="bLeft"> </td> <td cl

我的目标是制作一个类似于“相框”的HTML页面。换句话说,我想做一个空白的页面,周围有4张图片

这是我的代码:

<table>
    <tr>
        <td class="bTop" colspan="3">
        </td>
    </tr>
    <tr>
        <td class="bLeft">
        </td>
        <td class="middle">
        </td>
        <td class="bRight">
        </td>
    </tr>
    <tr>
        <td class="bBottom" colspan="3">
        </td>
    </tr>                                                    
</table>
我的问题是我在表格的单元格之间得到了很细的白线,我的意思是图片的边框不是连续的。如何避免这些空白

<table cellspacing="0" cellpadding="0">
编辑: 正如iGEL所指出的,这个解决方案已被正式弃用(尽管仍然有效),所以若您是从头开始,那个么您应该使用jnpcl的边界折叠解决方案

到目前为止,我实际上非常不喜欢这种变化(不经常使用表)。它使一些任务变得更复杂。例如,当您希望在同一位置(视觉上)包含两个不同的边框时,一行的边框为顶部,另一行的边框为底部。它们将崩溃(只显示其中一个)。然后,您必须研究如何计算边框的“优先级”,以及哪些边框样式“更强”(双边框与实心边框等)

我喜欢这样:

<table cellspacing="0" cellpadding="0">
  <tr>
    <td class="first">first row</td>
  </tr>
  <tr>
    <td class="second">second row</td>
  </tr>
</table>

----------

.first {border-bottom:1px solid #EEE;}
.second {border-top:1px solid #CCC;}
<style>
table, tr {border:hidden;}
td, th {border:hidden;}
</style>
<table style="border:hidden;"</table>

第一排
第二排
----------
.first{边框底部:1px实心#EEE;}
.second{边框顶部:1px实心#CCC;}
现在,随着边界塌陷,这将不起作用,因为总是有一个边界被移除。我必须用其他的方法(有更多的解决方案)。一种可能性是将CSS3与框阴影一起使用:

<table class="tab">
  <tr>
    <td class="first">first row</td>
  </tr>
  <tr>
    <td class="second">second row</td>
  </tr>
</table>​​​

<style>
.tab {border-collapse:collapse;}
.tab .first {border-bottom:1px solid #EEE;}
.tab .second {border-top:1px solid #CCC;box-shadow: inset 0 1px 0 #CCC;}​
</style>

第一排
第二排
​​​
.tab{边框折叠:折叠;}
.tab.first{边框底部:1px实心#EEE;}
.tab.second{边框顶部:1px实心#CCC;框阴影:插入0 1px 0#CCC;}​
您还可以使用类似“groove | ridge | inset | earth”的边框样式,只使用一个边框。但对我来说,这不是最佳的,因为我不能控制两种颜色


也许有一些简单而好的方法可以解决崩溃的边界,但我还没有看到它,老实说,我也没有花太多时间在它上面。也许这里有人能给我/我们看;)

对我来说,我需要这样做,以完全删除表格和所有单元格的边框。这根本不需要修改HTML,这对我的情况很有帮助

table, tr, td {
    border: none;
}

在自举环境中,最重要的答案都没有帮助,但应用以下选项将删除所有边界:

.noBorder {
    border:none !important;
}
适用于:

<td class="noBorder">

这就是我解决问题的原因:

在HTML tr标记中,添加以下内容:

style="border-collapse: collapse; border: none;"

这删除了表行上显示的所有边框。

在引导环境中,以下是我的解决方案:

    <table style="border-collapse: collapse; border: none;">
        <tr style="border: none;">
            <td style="border: none;">
            </td>
        </tr>
    </table>    

使用TinyMCE编辑器,我能够删除所有边框的唯一方法是使用如下样式的
border:hidden

<table cellspacing="0" cellpadding="0">
  <tr>
    <td class="first">first row</td>
  </tr>
  <tr>
    <td class="second">second row</td>
  </tr>
</table>

----------

.first {border-bottom:1px solid #EEE;}
.second {border-top:1px solid #CCC;}
<style>
table, tr {border:hidden;}
td, th {border:hidden;}
</style>
<table style="border:hidden;"</table>

表,tr{border:hidden;}
td,th{边界:隐藏;}
在HTML中,如下所示:

<table cellspacing="0" cellpadding="0">
  <tr>
    <td class="first">first row</td>
  </tr>
  <tr>
    <td class="second">second row</td>
  </tr>
</table>

----------

.first {border-bottom:1px solid #EEE;}
.second {border-top:1px solid #CCC;}
<style>
table, tr {border:hidden;}
td, th {border:hidden;}
</style>
<table style="border:hidden;"</table>
在全局Css中使用此Css样式

.table,
.monthview日期表td,
.monthview日期表th{
边界:没有!重要;

}
cellspacing和cellpadding自1999年以来就被弃用,请参见-您应该使用@jnpcl solution。iGEL是对的,我已经编辑了我的答案。老实说,我很惊讶,它被弃用了这么长时间,我仍然在使用它,没有任何问题:)这个建议在Wordpress中对我有效。我很难让border none得到执行。在这里我尝试了所有的建议,最后
border:none
应用于
td
说服jekyll制作一个无边界表: