如何在Visualforce页面中显示表数据?

发布于 2025-01-23 17:54:22 字数 308 浏览 3 评论 0原文

我无法水平显示记录。 在桌子上,从custom_object__c检索名称,roll_number,school_name,等级,school_phone和date_of_birth。现在,我想在Visualforce页面上水平显示这些项目。 下面是我需要的图像。请帮助

I was not able to display records in horizontally.
In a table am retrieving Name,Roll_Number,School_Name,Grade,School_Phone and Date_of_Birth from custom_object__c. Now i want to show these item horizontally in Visualforce pages.
below are image attached as i required. please help

enter image description here

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

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

发布评论

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

评论(1

裂开嘴轻声笑有多痛 2025-01-30 17:54:22

您需要对其进行更多的手册来制作,不要以为< apex:datatable> and < apex:pageblocktable>并非没有一些CSS技巧。

查看是否可以将您带到某个地方:

<apex:pageBlock>
    <apex:pageBlockSection columns="2">
        <apex:repeat value="{!contacts}" var="c">
            <apex:outputField value="{!c.Name}" />
            <apex:outputField value="{!c.Roll_Number__c}" />
            <apex:outputField value="{!c.School_Name__c}" />
            <apex:outputField value="{!c.Grade__c}" />
            <apex:outputField value="{!c.School_Phone__c}" />
            <apex:outputField value="{!c.Date_of_Birth__c}" />
            <!-- 
                if you want visual gaps - you could put pageBlockSections in the loop!
                or add some blank elements
            -->
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
        </apex:repeat>
    </apex:pageBlockSection>
</apex:pageBlock>

如果您在没有Salesforce样式的情况下需要它(但不能简单地&lt; Apex:Page StandardStyleSheets =“ false”) - 您仍然可以使用此结构来输出RAW HTML << code>&lt; table&gt;,st&lt&gt;,&lt; th&gt;,&lt; td&gt; 等。有很多示例如何进行原始HTML输出,尤其是PDF。无耻的插头: https://salesforce.stackexchange.com/a/a/194196/799

You'll need to craft it bit more manual, don't think <apex:datatable> and <apex:pageBlockTable> can create something like this, at least not without some CSS tricks.

See if this gets you somewhere:

<apex:pageBlock>
    <apex:pageBlockSection columns="2">
        <apex:repeat value="{!contacts}" var="c">
            <apex:outputField value="{!c.Name}" />
            <apex:outputField value="{!c.Roll_Number__c}" />
            <apex:outputField value="{!c.School_Name__c}" />
            <apex:outputField value="{!c.Grade__c}" />
            <apex:outputField value="{!c.School_Phone__c}" />
            <apex:outputField value="{!c.Date_of_Birth__c}" />
            <!-- 
                if you want visual gaps - you could put pageBlockSections in the loop!
                or add some blank elements
            -->
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
        </apex:repeat>
    </apex:pageBlockSection>
</apex:pageBlock>

If you need it without Salesforce styling (but can't simply <apex:page standardStylesheets="false") - you can still use this structure to output raw html <table>, <tr>, <th>, <td> etc. There are lots of samples how to do raw html output, especially for pdf. Shameless plug: https://salesforce.stackexchange.com/a/194196/799

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