ScrollableTable (ver 0.1 - 8/22/2009)

Requirements:

  1. The script requires that you include the Prototype JavaScript framework.
  2. You must wrap the table you wish to make scrollable in a div tag with a unique id attribute.
  3. You must define a thead and a tbody to differentiate the fixed header from the scrollable portion of the table.
  4. If you want to specify a table width, it must be a fixed width and not a percentage.

Files:

  1. scrollabletable.js
  2. scrollabletable.css

Usage:

<script type="text/javascript">
render_scrollable_table(element_id, scrollable_height);
</script>

Demo:

Col 1 Col 2 Col 3 Col 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4