gpt4 book ai didi

internet-explorer - Scrollable Div 只滚动结构,不滚动 IE8 和 IE9 兼容模式下 Primefaces 数据表的数据

转载 作者:行者123 更新时间:2023-12-04 05:20:27 24 4
gpt4 key购买 nike

div 滚动表格,但数据不会移动。它在 IE9(非兼容模式)和 Firefox 中运行良好。下面是一个简单的例子。有人知道解决方法吗?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head>
<title>Carousel Test</title>
</h:head>

<h:body>

<h:form id="evaluationForm">

<div style="overflow:auto; height:200px">
<p:dataTable value="#{evaluationBean.items}" var="item">
<p:column headerText="ID">
<h:outputText value="#{item.id}" />
</p:column>
</p:dataTable>
</div>

</h:form>

</h:body>

</html>

谢谢,
尼尔

最佳答案

只需通过以下方式关闭 IE 兼容模式

<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
</f:facet>
...
</h:head>

请注意 <f:facet name="first">特定于 PrimeFaces。因此,如果您不使用它,只需将其移除并放入 <meta>标签在 <h:head> 的最顶部,它也会工作得很好。关键是它必须出现在 PrimeFaces 生成的 <link> 之前。元素指向主题 CSS。另见 MSDN document :

The X-UA-Compatible header isn't case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements.



这意味着它在出现在例如 <link> 之后时将不起作用。元素。

关于internet-explorer - Scrollable Div 只滚动结构,不滚动 IE8 和 IE9 兼容模式下 Primefaces 数据表的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13742786/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com