You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何清除HTML/React表格行与列之间的空白区域?

如何移除表格中的空白区域?

我需要移除表格中存在的空白区域,但目前毫无头绪不知该如何实现。以下是实际React代码对应的HTML结构:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=   , initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table cellspacing="0">
        <div class="tableTitle"></div>
        <table class="subtable">
            <tr class="monthDisplay"></tr>
            <tr class="tableRow1">
                <tr></tr>
                <tr></tr>
                <tr></tr>
                <tr></tr>
                <tr>The problematic row after which the line appears</tr>
                <td class="problematicColumn"> //It seems that these columns also add some height
                    <tr>Jan 9, 2024</tr>
                    <tr>$214.41</tr>
                    <tr>$214.01</tr>
                    <tr>$6.61</tr>
                    <tr></tr>
                </td>
                <td>
                    <tr></tr>
                    <tr></tr>
                    <tr></tr>
                    <tr></tr>
                    <tr></tr>
                </td>
                ... 
            </tr>
            <tr class="tableRow2">
                <tr></tr>
                <tr></tr>
                <td></td>
                <td></td>
                ...
            </tr>
            <tr class="tableRow3">
                <tr></tr>
                <td></td>
                <td></td>
            </tr>
        </table>
    </table>
</body>
</html>

附上问题截图(已移除特定数据,红色箭头指向需移除的空白):
问题截图(红色箭头指向需移除的空白)

以下是我在HTML检查器中高亮problematicColumn的截图:
HTML检查器高亮problematicColumn的截图

请问有什么方法可以干净地移除该空白区域?


内容的提问来源于stack exchange,提问作者Marko Marchisio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 21:25:21