html 如何将两行“Ninja”合并为一行,并使用相同的名称“Ninja”?

yh2wf1be  于 2022-12-02  发布在  其他
关注(0)|答案(1)|浏览(127)

如何将两行'Ninja '合并为一行,并使用相同的名称'Ninja'?我在第一个Ninja中使用了行跨度,但它不起作用,为什么?i want to make the table looks good以下是我的代码:

<body>
    <Table style="width:100%" border="2" > <caption>Member's Data</caption>
        <thead>
            <tr>
                <th>Groupe </th>
                <th>Avatar</th>
                <th>Name</th>
                <th>Email</th>
                <th>Character</th>
                <th>profile</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td> Ninja </td>
                <td> 
                    <img src="https://icons.iconarchive.com/icons/apathae/satellite/256/2-Pictures-icon.png" alt="" height="40px" width="40px">
                
                </td>
                <td> Osama <br> Mohamed</td>
                <td>
                    o1@nn.sa <br> <hr> o2@nn.sa
                </td>
                <td>    &copy; </td>
                <td> <a href="https://www.google.com" target="_blank">profile</a></td>
            </tr>

        </tbody>
        <tbody>
                <tr>
                    <td>Ninja</td>
                    <td> 
                        <img src="https://icons.iconarchive.com/icons/treetog/i/256/Pictures-icon.png" alt="" height="40px" width="40px">
                    </td>
                    <td>Shady <br>Nabil </td>
                    <td>s@nn.sa </td>
                    <td>    &#8482; </td>
                    <td> <a href="https://www.gmail.com" target="_blank"> profile </a></td>
                </tr>
            </tbody>
            <tbody>
                <tr>
                    <td>Monsters</td>
                    <td> 
                        <img src="https://icons.iconarchive.com/icons/itzikgur/my-seven/256/Pictures-Canon-icon.png" alt="" height="40px" width="40px">
                    </td>
                    <td>Mohamed <br> Ibrahim</td>
                    <td> m@nn.sa </td>
                    <td> &reg; </td>
                    <td> <a href="https://www.amazon.com" target="_blank">profile</a></td>
                </tr>
        </tbody>

谢谢你的回答

5kgi1eie

5kgi1eie1#

您可以使用rowspan属性使单元格与其他单元格合并。要使它工作,您必须删除<thbody>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <Table style="width:100%" border="2" > <caption>Member's Data</caption>
        <thead>
            <tr>
                <th>Groupe </th>
                <th>Avatar</th>
                <th>Name</th>
                <th>Email</th>
                <th>Character</th>
                <th>profile</th>
            </tr>
        </thead>
            <tr>
                <td rowspan="2"> Ninja </td>
                <td> 
                    <img src="https://icons.iconarchive.com/icons/apathae/satellite/256/2-Pictures-icon.png" alt="" height="40px" width="40px">
                
                </td>
                <td> Osama <br> Mohamed</td>
                <td>
                    o1@nn.sa <br> <hr> o2@nn.sa
                </td>
                <td>    &copy; </td>
                <td> <a href="https://www.google.com" target="_blank">profile</a></td>
            </tr>
                <tr>
                    <td> 
                        <img src="https://icons.iconarchive.com/icons/treetog/i/256/Pictures-icon.png" alt="" height="40px" width="40px">
                    </td>
                    <td>Shady <br>Nabil </td>
                    <td>s@nn.sa </td>
                    <td>    &#8482; </td>
                    <td> <a href="https://www.gmail.com" target="_blank"> profile </a></td>
                </tr>
                <tr>
                    <td>Monsters</td>
                    <td> 
                        <img src="https://icons.iconarchive.com/icons/itzikgur/my-seven/256/Pictures-Canon-icon.png" alt="" height="40px" width="40px">
                    </td>
                    <td>Mohamed <br> Ibrahim</td>
                    <td> m@nn.sa </td>
                    <td> &reg; </td>
                    <td> <a href="https://www.amazon.com" target="_blank">profile</a></td>
                </tr>
        
</body>
</html>

输出如下:

相关问题