我想设置两个与 Visualforce 平行的 pageblock-Elements。我该怎么做?
<apex:page>
<apex:pageblock title="titleA" id="blockA">
</apex:pageblock>
<apex:pageblock title="titleB" id="blockB">
</apex:pageblock>
</apex:page>
谢谢
最佳答案
这真的是一个 CSS 问题,关于彼此相邻的 float div、使用 CSS 进行页面布局等。It's been asked on SO numerous times.将它们包装成 <apex:outputPanel>
,玩 float:right 等,你应该可以开始了。
如果您想要一个纯 Visualforce 解决方案并且对 CSS 不满意,您可以将它们呈现到表格中。关于如何 tables shouldn't be used for layouts 存在着整个哲学辩论虽然 ;)
<apex:panelGrid>
在这种情况下应该是最简单的。
<apex:page>
<apex:panelGrid columns="2">
<apex:pageblock title="titleA" id="blockA">
</apex:pageblock>
<apex:pageblock title="titleB" id="blockB">
</apex:pageblock>
</apex:panelGrid>
</apex:page>
关于salesforce - 如何在 Visualforce 中平行设置两个 pageblock-Elements?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15185944/