设置表格行高 [英] Setting table row height

查看:104
本文介绍了设置表格行高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码:

<table class="topics" >
    <tr>
        <td style="white-space: nowrap; padding: 0 5px 0 0; color:#3A5572; font-weight: bold;">Test</td>
        <td style="padding: 0 4px 0 0;">1.0</td>
        <td>abc</td>
    </tr>
    <tr>

        <td style="white-space: nowrap; padding: 0 5px 0 0; color:#3A5572; font-weight: bold;">test2</td>
        <td style="padding: 0 4px 0 0;">1.3</td>
        <td>def</td>
    </tr>
</table>

行间距太远.我希望线条更加紧密.

The rows are spaced too far apart. I want the lines closer together.

我所做的是添加以下CSS,但似乎没有任何改变.

What I did was to add the following CSS but it doesn't seem to change anything.

.topics tr { height: 14px; }

我在做什么错了?

推荐答案

尝试一下:

.topics tr { line-height: 14px; }

这篇关于设置表格行高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆