如何为WebKit(Chrome,Safari)的表格单元格设置50%的高度 [英] How to set 50% height for table cells for WebKit (Chrome, Safari)

查看:182
本文介绍了如何为WebKit(Chrome,Safari)的表格单元格设置50%的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看此代码:

<html>
<body>
    <table border="1px">
        <tr>
            <th align="center" width="70px">Name</th>
            <th align="center" width="70px">State</th>
            <th  align="center" width="70px">Enabled</th>
            <th colspan="2">Date &amp; Time</th>
            <th>Message</th>
        </tr>
        <tr>
            <td rowspan="2">
                <span>Import</span>
            </td>
            <td rowspan="2" align="center">
                Idle
            </td>
            <td rowspan="2" align="center">
                Yes
            </td>
            <td style="width:150px;">Start:</td>
            <td style="width:150px">28.10.2009 00:00:00</td>
            <td rowspan="2">
                The job succeeded.  The Job was invoked by User sa.  The last step to run was step 1 (Updating).The job succeeded.  The Job was invoked by User sa.  The last step to run was step 1 (Updating).The job succeeded.  The Job was invoked by User sa.  The last step to run was step 1 (Updating).The job succeeded.  The Job was invoked by User sa.  The last step to run was step 1 (Updating).
            </td>
        </tr>
        <tr>
            <td>Schedule:</td>
            <td>28.10.2009 13:41:37</td>
        </tr>
    </table>
</body>


包含Start和Schedule的字符串的高度需要相等。在IE中,Firefox默认具有相同的高度。是否可能实现相同的WebKit使用CSS?怎么样? (高度硬编码被禁止,消息大小是动态生成的)

Height of strings that contains Start and Schedule are needed to be equal. In IE, Firefox they have the same height by default. Is it possible to implement the same for WebKit using CSS? How? (Height hardcoding is forbidden, Message size is generated dynamically.)

推荐答案

height:50%? (周围的表,正文和HTML则需要height:100%。)

What's wrong with height:50%? (The surrounding table, body and HTML then need height: 100% as well.)

这篇关于如何为WebKit(Chrome,Safari)的表格单元格设置50%的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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