Is there any tag like <apex:pageblockTable> but to show the rows in column order?

Ie . Currently

 Name :  Age : country

 Bharath : 25 : INDIA

 Graham  : 26 : UK

 Andrew  : 27 : US

Now the expected format is

Name :   Bharath : Graham : Andrew

Age  :     25    : 26     : 27

Country:   IND   : UK     : US

Though I am not aware of any component which will help you transpose your table but you can get this with some simple css and html.


<apex:page controller="TableTransposeController">
        #transposeTable tr { 
            display: block;
            float: left; 
        #transposeTable th,#transposeTable td {
            display: block;
            border-bottom-style: inset;
            border-bottom-width: thin;
            border-left-style: outset;
        #transposeTable th{
            background: #f2f3f3;
            font-weight: bold;
        #transposeTable td{
            background: white;
        #transposeTable th:first-child,#transposeTable td:first-child{
            border-top-style: outset;
            border-top-width: thin;
        <table id="transposeTable">
                <th>First Name</th>
                <th>Last Name</th>
            <apex:repeat value="{!allContacts}" var="c">



public class TableTransposeController {

    public List getallContacts() {
        return [Select FirstNAme,LastName,Email from Contact limit 5];


Note: I have not handled horizontal overflow of this table as I believe this kind of representation is better suited when you have many fields to show for fewer records. e.g. When you compare two cell phone features side by side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.