首页 > 解决方案 > Html 表中的排列

问题描述

我偶然发现了这张桌子⤵️

在此处输入图像描述

有人可以告诉我如何获得

Days 行下方的“/”和“Time”?

这是代码:

<table border="2">
    <tr>
        <th rowspan="3">Days
        </th>
        <th rowspan="3">Monday</th>
        <th rowspan="3">Tuesday</th>
        <th rowspan="3">Wednesday</th>
        <th rowspan="3">Thursday</th>
        <th rowspan="3">Friday</th>
        <th rowspan="3">Saturday</th>
    </tr>
    <tr>
        <th>/</th>
    </tr>
    <tr>
        <th>Time</th>
    </tr>
</table>

标签: htmlhtml-table

解决方案


您需要rowspan从“天”列中删除(或将其设置为 1):

    <table border="2">
        <tr>
            <th>Days</th>
            <th rowspan="3">Monday</th>
            <th rowspan="3">Tuesday</th>
            <th rowspan="3">Wednesday</th>
            <th rowspan="3">Thursday</th>
            <th rowspan="3">Friday</th>
            <th rowspan="3">Saturday</th>
        </tr>
        <tr>
            <th>/</th>
        </tr>
        <tr>
            <th>Time</th>
        </tr>

    </table>


推荐阅读