[SalesForce] VisualForce version of HTML colspan command

Does anyone know how to get a visualforce page to have text span across 2 columns? I know the command in HTML would be a colspan command, but I have not been able to find the equivalent in Visualforce. Any help would be appreciated.

Best Answer

Assuming you want to do this in a table, you would use the colspan attribute of <apex:column>. Quoting from the documentation, colspan represents:

The number of columns that this column spans in the table. Note that this value does not apply to the header and footer cells.

Example:

<apex:datatable value="{! myList}" var="item">
  <apex:column colspan=2 value="{!item.column}"/>
</apex:datatable>

Note: Keep in mind that you can always apply custom CSS and classes to the apex controls.