使表格的颜色连接在一起(HTML)



我正试图让表中的这些不同颜色相互连接(这样它们之间就不会有太小的差距)。

<!---Content-->
<Center>
    <Table WIDTH = "75%">
        <TR>
            <TD WIDTH = "33%" BGCOLOR = "D Word">
            <Center>
            <P>HI THERE I am heRE n0w</P>
            <IMG SRC = "ImagesCstrike.gif" Width = "200" Height = "200">
            </Center>
            </TD>
            <TD WIDTH = "33%" BGCOLOR = "Blue">
            <Center>
            <P> BLAH Blah bLah Bl0h</P>
            <IMG SRC = "Imagesmauser3.gif" Width = "200" Height = "200">
            </Center>
            </TD>
            <TD WIDTH = "33%" BGCOLOR = "Grey">
            <Center>
            <P>ko</P>
            </Center>
            </TD>
        </TR>
    </Table>
</Center>

(还有可能让灰色的迷你表加入上面的另一个表吗?)这只是times 2上面的html代码(两者都是一样的),所以灰色的加入上面的灰色的,有什么帮助吗?

添加cellspacing="0"

<Table WIDTH = "75%" cellspacing="0">

是的,可以将灰色的迷你表与上面的另一个表连接。您需要提供更多详细信息或相关HTML。

<Table WIDTH = "75%" cellpadding="0" cellspacing="0">

首先,考虑使用CSS而不是不推荐使用的HTML属性。

在CSS中,可以将border-collapse: collapse;属性应用于表来删除单元格之间的间距。

示例

HTML:

<table>
    <tbody>
        <tr>
            <td class="first">Blah blah blah</td>
            <td class="second">Blah blah blah</td>
            <td class="third">Blah blah blah</td>
        </tr>
    </tbody>
</table>

CSS:

table {
    border-collapse: collapse;
}
td {
    border: 1pt solid silver;
    padding: 5pt;
}
.first, .second, .third {
    width: 33%;
}
.first {
    background-color: red;
}
.second{
    background-color: yellow;
}
.third{
    background-color: green;
}

请在此处查看实际示例。

最新更新