• #16726
    Salesforce | PRANAV PRANAV #679

    In Salesforce, how to display dynamic table records in horizontal format?

    Hi All,

    How to display dynamic table records in horizontal format?

    Actually the table records are selected by checkboxes and those selected records are displayed in an another table in horizontal format with headings in a single column.



    Salesforce | Vikas Kumar Vikas Kumar #319

    Hi pranav ,

    public class RowWrapper
    // the values (cells) making up this row
    public List<String> values {get; set;}

    // constructor
    public RowWrapper()
    values=new List<String>();

    // append a value (cell) to the row
    public void addValue(String value)

    public List<Account> getAccounts()
    if (null==accs)
    accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode from Account
    where BillingCity != null and BillingPostalCode!=null limit 3];

    return accs;

    // retrieves the list of row wrappers
    public List<RowWrapper> getRowWrappers()
    if (null==rows)
    rows=new List<RowWrapper>();

    // create a row for each field – there are 4 of these, Name, Street, City and PostCode
    for (Integer idx=0; idx<4; idx++)
    rows.add(new RowWrapper());

    // iterate the accounts and populate the rows
    for (Integer idx=0; idx<getAccounts().size(); idx++)

    return rows;

    Vf Page

    <table class=”list” border=”0″ cellpadding=”0″ cellspacing=”0″>
    <tr class=”headerRow “>
    <apex:repeat value=”{!headWrap.values}” var=”heading”>
    <th class=”headerRow “>
    <apex:repeat value=”{!rowWrappers}” var=”row”>
    <apex:repeat value=”{!row.values}” var=”value”>

    Go through This Blog



Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?