Click here to Skip to main content
Click here to Skip to main content

Scrollable HTML Table

, 6 Sep 2003
Rate this:
Please Sign up or sign in to vote.
Make your HTML tables scrollable with this simple method. No additional coding necessary!
<!-- Download Links --> <!-- Article image -->

Sample Image - Scrollable_Table.jpg

<!-- Add the rest of your HTML here -->


This JavaScript code can be used to convert tables in ordinary HTML into scrollable ones. No additional coding is necessary. All you need to do is put header rows in TBODY and give your table an ID field, include the ScrollableTable.js file and call makeScrollableTable in your document's onLoad method.

<script language="JavaScript" src=ScrollableTable.js></script>

<body onload="makeScrollableTable('tabela',true,'auto');">

<table border=0 id=tabela align=center 
  style="border-color: black; border-style: solid; border-width: 1;">
  <th bgcolor=blue style="color: white" rowspan=2 valign=bottom>ColA</th>
  <th bgcolor=blue style="color: white" colspan=2 align=center>ColBC</th>
  <th bgcolor=blue style="color: white" colspan=2 align=center>ColDE</th>
  <th bgcolor=blue style="color: white" rowspan=2 valign=bottom>ColF</th>
  <th bgcolor=blue style="color: white">ColB</th>
  <th bgcolor=blue style="color: white">ColC</th>
  <th bgcolor=blue style="color: white">ColD</th>
  <th bgcolor=blue style="color: white">ColE</th>
  <td bgcolor=blue style="color: white" colspan=6 align=center>Footer</td>


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Wagner DosAnjos

United States United States
No Biography provided

Comments and Discussions

GeneralNot working inside div tag "<div>"'</div> PinmemberMember 366988930-May-09 0:25 
GeneralComplete scrollable table Pinmembershahib17-Nov-08 5:56 
General"out of stack space" error Pinmembermikem4223-Apr-08 10:55 
Generalonly first line aligns correctly - solved Pinmemberniik26-Sep-07 4:39 
QuestionScrollable table with percentage width PinmemberSmitaU25-Sep-07 1:33 
GeneralChange input value in footer Pinmembertitus6922-Mar-07 2:11 
GeneralHelp me with Horizontal scroll Pinmembermanivd29-Nov-06 19:50 
QuestionHow to make scrollbar work dynamic? Pinmemberabergdavid14-Nov-06 11:13 
GeneralScrollbars not displaying with the XHTML DOCTYPE PinmemberRick-N-Roll28-Sep-06 13:19 
GeneralScrollable table that dynamically resizes columns -- no need to preset widths for IE Pinmemberdizzee_rascal18-Jul-06 16:55 
GeneralfixTableWidth Problem Pinmemberchris lasater19-Jan-06 7:15 
QuestionScrollable HTML Table Pinmemberndhai3-Dec-05 6:35 
Generalsome table work on javascript Pinsusssumera nazli14-Oct-05 8:47 
QuestionHow to make horizontal scrolling Pinmembersach_oz9-Sep-05 21:53 
GeneralNo scrollbar in Mozilla and netscape Pinmembermarine_costal5-Jul-05 11:05 
GeneralRe: No scrollbar in Mozilla and netscape PinmemberRohit Joshi23-Feb-07 5:09 
GeneralRe: No scrollbar in Mozilla and netscape PinmemberTerri Layman17-Sep-08 11:09 
GeneralRe: No scrollbar in Mozilla and netscape Pinmemberfrankfry22-Sep-08 4:59 
QuestionRe: No scrollbar in Mozilla and netscape Pinmemberslymenk8-May-09 3:05 
GeneralRe: No scrollbar in Mozilla and netscape Pinmemberslamb824-Mar-10 6:04 
Generalprogram not compiling, stops at thead PinmemberLisaleb15-Jun-05 16:00 
Questionsorting? Pinmemberraforaez7-Jun-05 5:22 
GeneralMozilla Firefox support PinsussAnonymous20-May-05 0:12 
GeneralRe: Mozilla Firefox support PinmemberRohit Joshi23-Feb-07 5:10 
GeneralNo scrollbar in Mozilla Pinmemberclairelw23-Mar-05 1:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150129.1 | Last Updated 7 Sep 2003
Article Copyright 2002 by Wagner DosAnjos
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid