表中的第一条记录与 IE 中的表头重叠

发布于 2024-07-19 04:57:09 字数 3153 浏览 6 评论 0原文

创建了一个在 IE6,7 中工作正常的表,但在 FF 中标题隐藏了第一个数据行。

<g:if test="${params.history!=null}">
<div style="width:791px;padding-bottom:10px;overflow-y:auto;${(lstDNCallEntries.size()>0)?'height:100px':''}">
<table class="table">
<thead style="position: absolute;">
 <% params=params.findAll{ k,v -> k != 'sort'} %>
<td class="certify_head" width="87" style="text-align: center">title</td>
<td class="certify_head" width="89" style="text-align: center" >action</td>
            <td class="certify_head" width="66" style="text-align: center" >list</td>
            <td class="certify_head" width="118" style="text-align: center" >selection</td>
            <td class="certify_head" width="110" style="text-align: center" >source</td>
            <td class="certify_head" width="64" style="text-align: center" >${message(code:'phoneoptoutgranularity.gsp~title.user')}</td>
            <td class="certify_head" width="82" style="text-align: center" >Office</td>
            <td class="certify_head" width="90" style="text-align: center" >Effective Date</td>
        </thead>
        <tbody class="scrollContent">
            <g:if test="${lstDNCallEntries.size() > 0}">
                <g:each in="${lstDNCallEntries}" var="phoneHistory" status="i">
                    <tr class="${(i % 2) == 0 ? 'normalRow' : 'alternateRow'}"
                            onMouseOver="this.style.backgroundColor='#ffffd9'"
                            onMouseOut="this.style.backgroundColor=''">
                        <td width="90" align="center" valign="center">${phoneHistory.date}</td>
                        <td width="92" valign="center" style="font: normal 12px Arial, Helvetica, sans-serif;">${phoneHistory.action}</td>
                        <td width="71" align="center" valign="center">${phoneHistory.list}</td>
                        <td width="122" align="center" valign="center">${phoneHistory.preferencekey}</td>
                        <td width="110" align="center" valign="center">${phoneHistory.source}</td>
                        <td width="69" align="center" valign="center">${phoneHistory.user}</td>
                        <td width="85" align="center" valign="center">${phoneHistory.office}</td>
                        <td width="90" align="center" valign="center">${phoneHistory.effectiveDate}</td>
                    </tr>
                </g:each>
            </g:if>
            <g:else>
                <tr>
                    <b>
                    <td colspan="7" width="770" align="center"><b><g:message
                        code="phoneoptoutgranularity.gsp~historydetails" /></b></td>
                    </b>
                </tr>
            </g:else>
        </tbody>
    </table>
    </div>
</g:if> 

请大家帮忙看看哪里可以修改。

-ss

Created a table which works fine in IE6,7 but in FF the header hides the first datarow.

<g:if test="${params.history!=null}">
<div style="width:791px;padding-bottom:10px;overflow-y:auto;${(lstDNCallEntries.size()>0)?'height:100px':''}">
<table class="table">
<thead style="position: absolute;">
 <% params=params.findAll{ k,v -> k != 'sort'} %>
<td class="certify_head" width="87" style="text-align: center">title</td>
<td class="certify_head" width="89" style="text-align: center" >action</td>
            <td class="certify_head" width="66" style="text-align: center" >list</td>
            <td class="certify_head" width="118" style="text-align: center" >selection</td>
            <td class="certify_head" width="110" style="text-align: center" >source</td>
            <td class="certify_head" width="64" style="text-align: center" >${message(code:'phoneoptoutgranularity.gsp~title.user')}</td>
            <td class="certify_head" width="82" style="text-align: center" >Office</td>
            <td class="certify_head" width="90" style="text-align: center" >Effective Date</td>
        </thead>
        <tbody class="scrollContent">
            <g:if test="${lstDNCallEntries.size() > 0}">
                <g:each in="${lstDNCallEntries}" var="phoneHistory" status="i">
                    <tr class="${(i % 2) == 0 ? 'normalRow' : 'alternateRow'}"
                            onMouseOver="this.style.backgroundColor='#ffffd9'"
                            onMouseOut="this.style.backgroundColor=''">
                        <td width="90" align="center" valign="center">${phoneHistory.date}</td>
                        <td width="92" valign="center" style="font: normal 12px Arial, Helvetica, sans-serif;">${phoneHistory.action}</td>
                        <td width="71" align="center" valign="center">${phoneHistory.list}</td>
                        <td width="122" align="center" valign="center">${phoneHistory.preferencekey}</td>
                        <td width="110" align="center" valign="center">${phoneHistory.source}</td>
                        <td width="69" align="center" valign="center">${phoneHistory.user}</td>
                        <td width="85" align="center" valign="center">${phoneHistory.office}</td>
                        <td width="90" align="center" valign="center">${phoneHistory.effectiveDate}</td>
                    </tr>
                </g:each>
            </g:if>
            <g:else>
                <tr>
                    <b>
                    <td colspan="7" width="770" align="center"><b><g:message
                        code="phoneoptoutgranularity.gsp~historydetails" /></b></td>
                    </b>
                </tr>
            </g:else>
        </tbody>
    </table>
    </div>
</g:if> 

Please help where i can modify.

-ss

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

地狱即天堂 2024-07-26 04:57:09

您似乎缺少顶行中的

Looks like you're missing the <tr> in your top row.

好多鱼好多余 2024-07-26 04:57:09

为什么 position:absolute 在那里? 从我的头顶上看, pos:abs 会将 thead 从流程中取出,这将使第一行向上有效地隐藏它。 也许你可以在第一行添加一些边距/填充来解决这个问题,但你必须首先证明 pos:abs 的合理性。

我可以看到的另一件事是,所有 thead 内容都是 td 的,而不是 th 的,但我怀疑这会产生这种效果。

编辑:粗略地测试了一下,这绝对是 pos:abs (万恶之源:P)。 也许您想要 position:fixed 来代替? 另一张海报是对的,你缺少一个 tr

Why is that position:absolute in there? Off the top of my head, pos:abs will take the thead out of the flow which will bump the first row up effectively hiding it. Possibly you could fix this with some margin/padding on the first row but you'd have to justify the pos:abs first.

The other thing I can see is that all the thead contents are td's not th's, but I doubt that would create this effect.

edit: gave it a rough test, it's definitely the pos:abs (root of all evil :P). Possibly you want position:fixed instead? And the other poster is right, you're missing a tr

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文