Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



adding vertical scroll bar for the table in css

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-06-2009
Member
 
Join Date: Oct 2008
Posts: 47
adding vertical scroll bar for the table in css
  

Hi,

I want to have a vertical scroll to mt table which fetch values from my database.
I want to fix the height of the table & then navigate it with the scroll.
If you can help me with the scroll that will be very helpful.

help me with the vertical scroll bar for the table in css.

Reply With Quote
  #2  
Old 29-06-2009
Member
 
Join Date: Apr 2008
Posts: 242
Re: adding vertical scroll bar for the table in css

Try this:
Code:
#main
{
width:100%;
height:100%;
overflow:auto;
}

<td width="100%">
<div id="main">
<table width="99%" border="0">
<tr>
<td width="97%" valign="top">
text
</td>
</tr>
</table>
</div>
</td>
Reply With Quote
  #3  
Old 29-06-2009
Member
 
Join Date: Aug 2008
Posts: 90
Re: adding vertical scroll bar for the table in css

I tend to go with a containing div:

Code:
div.scroll {
  overflow:auto;
  padding-right:6px;
}
You'll need to add a height attribute somewhere for this to work! I usually have a default set in the div.scroll declaration in html
Code:
<div class="scroll" >
  <table>
  <!-- your table stuff in here -->
  </table>
</div>
Reply With Quote
  #4  
Old 29-06-2009
Member
 
Join Date: Oct 2008
Posts: 93
Re: adding vertical scroll bar for the table in css

You can not with TABLE Element, You do can with DIV

<div style="overflow: scroll/auto/hidden;"></div>

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#777770" text="#ffffff">

<div style="height: 420px; overflow: scroll;">
       <table width="100%" height="420px" border="1">
           <tr>
               <td width="70%" valign="top" height="400px" class="component"><jdoc:include type="component" />
                   
                </td>
                <td class="valign">
                   <table class="table1" border="0">   
                       <tr>
                         <td height="10px"> <div id="recent"> Recent Project  </div> </td>
                        </tr>
                        <tr>
                           <td> <jdoc:include type="modules" name="recentproj" /></td>
                        </tr></table>
                </td>
                </tr>
               
        </table>
</div>

</body>
</html>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "adding vertical scroll bar for the table in css"
Thread Thread Starter Forum Replies Last Post
After updating to Mac OS X Lion, Lost vertical scroll on magic mouse pasture Operating Systems 5 21-11-2011 09:55 PM
Display vertical scroll bar in Word 2010 Skullnit Windows Software 1 30-08-2011 11:28 PM
Adding scroll bars to images in excel sheet arungiles Tips & Tweaks 1 05-08-2011 03:37 PM
Satellite A335-S6879 Windows 7 64-bit No Display brightness control and no vertical scroll touchpad Savannah87 Portable Devices 4 09-04-2010 06:45 AM
Different ways of using sql query for adding values in the table REDBULL Software Development 3 13-11-2009 07:58 AM


All times are GMT +5.5. The time now is 12:00 AM.