开发者

Making colors of table join together (HTML)

I'm trying to get these different colors in the table to join each other, (so there isn't the small gap between them).

<!---Content-->

<Center>
    <Table WIDTH = "75%">
        <TR>

            <TD WIDTH = "33%" BGCOLOR = "D Word">
            <Center>
            <P>HI THERE I am heRE n0w</P>
            <IMG SRC = "Images\Cstrike.gif" Width = "200" Height = "200">
            </Center>
            </TD>

            <TD WIDTH = "33%" BGCOLOR = "Blue">
            &开发者_开发技巧lt;Center>
            <P> BLAH Blah bLah Bl0h</P>
            <IMG SRC = "Images\mauser3.gif" Width = "200" Height = "200">
            </Center>
            </TD>

            <TD WIDTH = "33%" BGCOLOR = "Grey">
            <Center>
            <P>ko</P>
            </Center>
            </TD>

        </TR>
    </Table>
</Center>

(And also is it possible to have the mini table in grey to join another table above it?)It's just the html code above times 2 (There both the same thing) so the grey one join the grey one above it, any help?


Add cellspacing="0"

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

Yes, it is possible to have the mini table in grey to join another table above it. You need to provide more details or related HTML.


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


First, consider using CSS instead of deprecated HTML properies.

In CSS, you can remove the spacing between cells applying the border-collapse: collapse; property to the table.

Example

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;
}

See a live example here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜