salesforce - 如何在 Visualforce 中平行设置两个 pageblock-Elements?

标签 salesforce apex-code visualforce

我想设置两个与 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/

相关文章:

google-maps-api-3 - 无法使用 Salesforce Crypto Class for Google Maps API 生成 HMac

salesforce - 如何在 Visualforce 页面上仅显示从自定义验证中提取的错误消息?

javascript - 在 Visualforce 页面中显示 Chatter 文件的 PDF

salesforce - 获取变量不存在: String in an apex method

java - 基本的 XML 解析问题。无法通过 Java XmlStreamReader 方法找到节点名称。有任何想法吗?

salesforce - 如何在 VisualForce 页面中实现 "Save & New"功能

javascript - Visualforce 远程处理 : Parameter length does not match remote action

java - 在 Salesforce 的实体选项卡中创建自定义页面 block

namespaces - Salesforce 中有多少个命名空间

salesforce - 澄清 soql 查询的调控器限制