+ Start a Discussion

Freezing row columns in a datatable

OK .. here's an interesting one.  I have a datatable that has a bunch of columns where we want to have scrollbars.  However, we need the first column to stay static, i.e. as I scroll horizontally it will always be there.  But if I scroll vertically, it needs to scroll with the rest of the rows.  Any ideas how to do this?


Here's an example:






I think this could be done natively, with a little HTML:


	<table style="max-height: 500px; overflow: scroll">
			<apex:datatable value="{!recordslist}" var="rec">
				<apex:column value="{!rec.Name}"/>
		</td><td style="max-width: 600px; overflow: scroll">
			<apex:datatable value="{!recordslist}" var="rec">
				<apex:column value="{!rec.field1}"/>
				<apex:column value="{!rec.field2}"/>