HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Table with Vertical Scrollbar
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
neutrogina



Joined: 06 May 2008
Posts: 2

PostPosted: Wed May 07, 2008 12:03 am     Table with Vertical Scrollbar Reply with quote

I wanted to have the scrollbar in my table inside my web page instead of extending the page making it longer when I have plenty of text...
This is what I have at the moment:
Code:
<td height="420px"> </td>
    <td height="420px">
       <table width="100%" height="420px" border="1">
           <tr>
               <td width="70%" valign="top" height="400px" overflow:"auto"; 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>
Straystudio



Joined: 14 Apr 2008
Posts: 92
Location: Nord Italy

PostPosted: Wed May 07, 2008 12:55 am     <div style="overflow: [i]scroll/auto/hidden[/i];&quo Reply with quote

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

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

scroll always prints both the vertical and the horizontal scroll-bars
auto makes one or the others or both to appear as soon as content grows;
hidden always prevent both scroll-bars from appearing.

DIV can either contain a TABLE (as code below) and be contained in a TD table-cell.
If DIV inside a table at whichsoever level of the document, HEIGHT You want to assign to a <div style="overflow: ;"> gets fooled if given in % percentuage; still works fine in pixel, instead.
With DIV beeing just contained in BODY Element directly, this issue does not occur.

Process this:
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>


Or so:
Code:


       <table width="100%" height="420px" border="1">
           <tr>
               <td width="70%" valign="top" height="400px" class="component">
                   <div style="height: 400px; overflow: auto;">
                   <jdoc:include type="component" />
                   </div>
                </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>

neutrogina



Joined: 06 May 2008
Posts: 2

PostPosted: Wed May 07, 2008 1:13 am     The scrollbar is now working! Reply with quote

Thank you very much!
The scrollbar now appears,now I won't worry of having very long pages... Very Happy
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial