Click here to Skip to main content
13,096,858 members (82,452 online)
Click here to Skip to main content
Add your own
alternative version


72 bookmarked
Posted 8 Dec 2002

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

You may also be interested in...

Comments and Discussions

GeneralComplete scrollable table Pin
shahib17-Nov-08 4:56
membershahib17-Nov-08 4:56 
General"out of stack space" error Pin
mikem4223-Apr-08 9:55
membermikem4223-Apr-08 9:55 
Generalonly first line aligns correctly - solved Pin
niik26-Sep-07 3:39
memberniik26-Sep-07 3:39 
QuestionScrollable table with percentage width Pin
SmitaU25-Sep-07 0:33
memberSmitaU25-Sep-07 0:33 
GeneralChange input value in footer Pin
titus6922-Mar-07 1:11
membertitus6922-Mar-07 1:11 
GeneralHelp me with Horizontal scroll Pin
manivd29-Nov-06 18:50
membermanivd29-Nov-06 18:50 
QuestionHow to make scrollbar work dynamic? Pin
abergdavid14-Nov-06 10:13
memberabergdavid14-Nov-06 10:13 
GeneralScrollbars not displaying with the XHTML DOCTYPE Pin
Rick-N-Roll28-Sep-06 12:19
memberRick-N-Roll28-Sep-06 12:19 
GeneralScrollable table that dynamically resizes columns -- no need to preset widths for IE Pin
dizzee_rascal18-Jul-06 15:55
memberdizzee_rascal18-Jul-06 15:55 
GeneralfixTableWidth Problem Pin
chris lasater19-Jan-06 6:15
memberchris lasater19-Jan-06 6:15 
QuestionScrollable HTML Table Pin
ndhai3-Dec-05 5:35
memberndhai3-Dec-05 5:35 
Generalsome table work on javascript Pin
sumera nazli14-Oct-05 7:47
susssumera nazli14-Oct-05 7:47 
QuestionHow to make horizontal scrolling Pin
sach_oz9-Sep-05 20:53
membersach_oz9-Sep-05 20:53 
GeneralNo scrollbar in Mozilla and netscape Pin
marine_costal5-Jul-05 10:05
membermarine_costal5-Jul-05 10:05 
GeneralRe: No scrollbar in Mozilla and netscape Pin
Rohit Joshi23-Feb-07 4:09
memberRohit Joshi23-Feb-07 4:09 
GeneralRe: No scrollbar in Mozilla and netscape Pin
Terri Layman17-Sep-08 10:09
memberTerri Layman17-Sep-08 10:09 
GeneralRe: No scrollbar in Mozilla and netscape Pin
frankfry22-Sep-08 3:59
memberfrankfry22-Sep-08 3:59 
QuestionRe: No scrollbar in Mozilla and netscape Pin
slymenk8-May-09 2:05
memberslymenk8-May-09 2:05 
GeneralRe: No scrollbar in Mozilla and netscape Pin
slamb824-Mar-10 5:04
memberslamb824-Mar-10 5:04 
Generalprogram not compiling, stops at thead Pin
Lisaleb15-Jun-05 15:00
memberLisaleb15-Jun-05 15:00 
Questionsorting? Pin
raforaez7-Jun-05 4:22
memberraforaez7-Jun-05 4:22 
GeneralMozilla Firefox support Pin
Anonymous19-May-05 23:12
sussAnonymous19-May-05 23:12 
GeneralRe: Mozilla Firefox support Pin
Rohit Joshi23-Feb-07 4:10
memberRohit Joshi23-Feb-07 4:10 
GeneralNo scrollbar in Mozilla Pin
clairelw23-Mar-05 0:30
memberclairelw23-Mar-05 0:30 
GeneralRe: No scrollbar in Mozilla Pin
Rohit Joshi23-Feb-07 4:09
memberRohit Joshi23-Feb-07 4:09 
Generalhorizontal scrollbar - solved problem Pin
Boneripper17-Dec-04 1:05
memberBoneripper17-Dec-04 1:05 
GeneralRe: horizontal scrollbar - solved problem Pin
Anonymous20-May-05 0:28
sussAnonymous20-May-05 0:28 
GeneralPage Resizing Pin
kitana_q12-Oct-04 8:13
memberkitana_q12-Oct-04 8:13 
GeneralUsing images in table body Pin
Peter Black16-Sep-04 6:22
memberPeter Black16-Sep-04 6:22 
GeneralRe: Using images in table body Pin
Peter Black16-Sep-04 6:48
memberPeter Black16-Sep-04 6:48 
Generalscrollable table with fixed top header and left header Pin
amitas12-Apr-04 1:24
memberamitas12-Apr-04 1:24 
Generalhi Pin
hongwl94@hotmail.com17-Mar-04 14:56
memberhongwl94@hotmail.com17-Mar-04 14:56 
GeneralVertical scroll only Pin
aksoo23-Nov-03 22:28
memberaksoo23-Nov-03 22:28 
GeneralRe: Vertical scroll only Pin
Anonymous16-May-04 23:46
sussAnonymous16-May-04 23:46 
GeneralRe: Vertical scroll only Pin
ndhai3-Dec-05 6:26
memberndhai3-Dec-05 6:26 
Questionhow does one print just that table? Pin
Anonymous12-Nov-03 20:39
sussAnonymous12-Nov-03 20:39 
AnswerRe: how does one print just that table? Pin
mikeAgent26-May-04 9:16
membermikeAgent26-May-04 9:16 
GeneralColumn headers not aligned with table Pin
a_soong11-Nov-03 14:05
membera_soong11-Nov-03 14:05 
GeneralRe: Column headers not aligned with table Pin
a_soong11-Nov-03 14:15
membera_soong11-Nov-03 14:15 
GeneralRe: Column headers not aligned with table Pin
Brajagopal Bhar14-Jul-04 3:26
memberBrajagopal Bhar14-Jul-04 3:26 
GeneralRe: Column headers not aligned with table Pin
ndhai3-Dec-05 6:36
memberndhai3-Dec-05 6:36 
GeneralInput Data Doubeled Pin
rread10-Oct-03 6:04
memberrread10-Oct-03 6:04 
GeneralRe: Input Data Doubeled Pin
jeristotle11-Nov-04 7:23
memberjeristotle11-Nov-04 7:23 
Generalleading blanks in table Pin
Anonymous9-Sep-03 9:05
sussAnonymous9-Sep-03 9:05 
Questionscrollbar on left? Pin
Bill Colquhoun9-Sep-03 3:49
memberBill Colquhoun9-Sep-03 3:49 
AnswerRe: scrollbar on left? Pin
Anonymous20-May-05 2:04
sussAnonymous20-May-05 2:04 
GeneraltHead line up with tBody Pin
brian qing9-Aug-03 19:16
memberbrian qing9-Aug-03 19:16 
GeneralRe: tHead line up with tBody Pin
penguin00121-Feb-05 12:35
susspenguin00121-Feb-05 12:35 
GeneralScrolling Pin
Anonymous27-Jun-03 10:13
sussAnonymous27-Jun-03 10:13 
GeneralVertical + Horizontal scrolling Pin
Samwin27-Apr-03 20:01
sussSamwin27-Apr-03 20:01 

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

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

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