在CSS中设置表行高 [英] Setting table row height in CSS

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

问题描述

我有这个代码:

<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.

.topics tr { height: 14px; }

我做错了什么?

推荐答案

请尝试:

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

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

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