首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何完全去除HTML表格边框?

如何完全去除HTML表格边框?
EN

Stack Overflow用户
提问于 2018-12-11 08:18:55
回答 2查看 102关注 0票数 0

我已经阅读了关于这个主题的其他答案,但经过几个小时的尝试后-我仍然找不到解决方案。

我有一个网站,我正在照顾,我需要在HTML表头的单元格是无边界的。

网站是http://vcollection.com,而我遇到困难的表格是这个:http://prntscr.com/ltb9o9

你可以在屏幕截图上看到我的风格,但我不能摆脱边框:http://prntscr.com/ltbb19

有趣的是,当将表格宽度缩小1px时,该问题似乎在偶数像素宽度(即962px,960px,958px...)上仍然存在,但在奇数像素宽度(963px,961px,959px等)时不存在。

我试着重现,但似乎做不到:

代码语言:javascript
复制
.linear-background-header {
	background-image: linear-gradient(#454545, black);
	border: 0;
	background-color: transparent;
}
.main-header-section {
	display: inline-block;
}
span.header-font {
    font-family: Century Gothic;
    font-family: sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #999999;
}
代码语言:javascript
复制
<table border="0" cellspacing="0" cellpadding="0" style="background-color:transparent; margin-top:-25px; width:963px; border-collapse: collapse; border: 0; border-spacing: 0">
			<thead>
            <tr style="background-image: linear-gradient(#454545, black)">
                <th class="linear-background-header">
                    <div class="main-header-section">
                        <span class="header-font">New Products</span>
                    </div>
                </th>
                <th class="linear-background-header" style="padding: 0; line-height: 0">
                    <img src="https://vcollection.com/assets/images/separator.png" style="height: 36px; cursor: auto;">
                </th>
                <th class="linear-background-header">
                    <div class="main-header-section">
                        <span class="header-font">Car Mat Configurator</span>
                    </div>
                </th>
                <th class="linear-background-header" style="padding: 0; line-height: 0">
                    <img src="https://vcollection.com/assets/images/separator.png" style="height: 36px; cursor: auto;">
                </th>
                <th class="linear-background-header">
                    <div class="main-header-section">
                        <span class="header-font">Follow Us On Social Media</span>
                    </div>
                </th>
            </tr>
				</thead>
				<br>
			<tr height="5px"></tr>
		<tr >
			<td class="newprodwid" style="width:324px" >dummy
			</td>
			<td width="15px"></td>
			<td class="newprodwid"  style="width:340px">dummy
			</td>
			<td width="15px"></td>
			<td style="width:278px" >
				dummy
			 </td></tr>
		</table>

EN

回答 2

Stack Overflow用户

发布于 2018-12-11 09:17:56

我知道这就是Chrome issue。所有其他浏览器都可以正常工作,但Chrome有时会根据屏幕分辨率的不同而表现得像这样。

票数 1
EN

Stack Overflow用户

发布于 2018-12-11 08:21:29

这需要一些CSS。如果您使用的是<style>标记或CSS文件,只需使用

代码语言:javascript
复制
table * {
    border: none;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53715654

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档