+ Start a Discussion

apex:outputtext fixed length???

Hi All,


I thought this should be a pretty straightfoward thing but I was not able to find anything about it.


Basically in a datatable I am displaying names in a column using apex:outputtext(by binding results returned by a list in a controller class). These names are of varying lengths. I am displaying icons next to the names and want to format the names to be of fixed length so that the icons can line up.


I thought that there would be a length attribute or something to that effect. Is there anything that helps us to specify a fixed length in any visualforce text component. ?




Have you considered placing the icon inside an <apex:outputpanel

and aligning it to the right, for example?


Are you thinking about using the length to fill the field with blank-spaces? In that case, take into account that you will need to use a font with the same width per letter




Hey thanks for your reply.  I am currently aligning the images to the right. I wanted to know if there was a better solution such as just specifying a fixed width of some sort.