外边框为黑色但内边框为灰色的表格

发布于 2024-08-29 07:20:07 字数 329 浏览 3 评论 0原文

我想创建一个带有 1pt 黑色外边框和每个 td 周围相同边框的 html 表格。

应该看起来像这样(当然,只有边框)

在此处输入图像描述

我使用

<table border="1" style="border-collapse:collapse; border-color:Black; border-style:solid; border-width:1pt">

结果我得到了黑色的外层,但是内部边框是灰色的。

I want to create a html table with a 1pt black outer border and the same border around every td.

Should look like this (only the borders, of course)

enter image description here

I use

<table border="1" style="border-collapse:collapse; border-color:Black; border-style:solid; border-width:1pt">

As a result I get a black outer, but grey inner borders.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小矜持 2024-09-05 07:20:07

您可以尝试在 CSS 样式表中实现类似的内容。

.mytable
{
border-collapse:collapse; 
border-color:#000000; 
border-style:solid; 
border-width:2px;
}

.mytable td
{
border-color:#cccccc; /*grey*/
border-style:solid; 
border-width:1px;
}

类似这样的 HTML:

<table class="mytable">
    <tr>
        <td>Content</td>
    </tr>
</table>

示例

You could try implement something like this in your CSS stylesheet.

.mytable
{
border-collapse:collapse; 
border-color:#000000; 
border-style:solid; 
border-width:2px;
}

.mytable td
{
border-color:#cccccc; /*grey*/
border-style:solid; 
border-width:1px;
}

And something like this HTML:

<table class="mytable">
    <tr>
        <td>Content</td>
    </tr>
</table>

Example here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文