473,583 Members | 3,155 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Only Vertical Scroll bar no horizontal bars

Hi,

I am struggling with a problem for sometimes. I need to display a table in
a html and if the height of the table goes beyond 200 px then a vertical
scrollbar should alone appear without any horizontal scroll bar. If the
height of the table is less than 200 px then no scroll bars should appear.
Here is the html below. I tried to wrap the table around a <div> tag but
its doesn't work out as the scroll bar appear close to the scroll bar of
the page rather than close to the table. Further if the height of the
table is less than 200 px (i.e., with fewer number of rows like just 2
rows) then also the scroll bars appear.

Am I missing anything in this? Or Is there any other better solution to
this? I would appreciate any help to solve this problem.

<html><head><ti tle>Table test</title>
<style type="text/css">
body { font-family: arial;}
table { border-color: darkblue; border-style: solid; border-width: 1px;
}
td, th {
font-family: Arial; font-size: 10pt; background-color: grey;
padding: 2px; padding-left: 6px; padding-right: 6px;
}
.section-header{
background-color: darkblue; font-size : 18px; font-weight: bold;
font-style: normal; text-align: left; padding-left: 5px; vertical-align:
middle;
}
</style>
</head>
<body>
<div style="height:2 00px; overflow:scroll ">
<table cellpadding="0" cellspacing="1" width="800px">
<thead>
<tr style="backgrou nd-color:#008000;c olor:#ffffff;">
<th class="section-header">name</th>
<th class="section-header">positio n</th>
<th class="section-header">Number added</th>
<th class="section-header">Number removed</th>
</thead>
<tbody>
<tr><td>aaa</td><td>left</td><td>122-456-789</td><td>122-456-788</td></t
r>
<tr><td>bbb</td><td>left</td><td>123-456-789</td><td>123-456-788</td></t
r>
<tr><td>ccc</td><td>right</td><td>233-456-789</td><td>233-456-788</td></
tr>
<tr><td>ddd</td><td>left</td><td>234-456-789</td><td>234-456-788</td></t
r>
<tr><td>eee</td><td>right</td><td>238-456-789</td><td>238-456-788</td></
tr>
<tr><td>fff</td><td>right</td><td>235-456-789</td><td>235-456-788</td></
tr>
<tr><td>ggg</td><td>left</td><td>236-456-789</td><td>236-456-788</td></t
r>
<tr><td>aaa</td><td>left</td><td>122-456-789</td><td>122-456-788</td></t
r>
<tr><td>bbb</td><td>left</td><td>123-456-789</td><td>123-456-788</td></t
r><tr>
<td>ccc</td><td>right</td><td>233-456-789</td><td>233-456-788</td></tr>
<tr><td>ddd</td><td>left</td><td>234-456-789</td><td>234-456-788</td></t
r>
<tr><td>eee</td><td>right</td><td>238-456-789</td><td>238-456-788</td></
tr>
<tr><td>fff</td><td>right</td><td>235-456-789</td><td>235-456-788</td></
tr>
<tr><td>ggg</td><td>left</td><td>236-456-789</td><td>236-456-788</td></t
r>
</tbody>
</table>
</div>
</body>
</html>
-------------------------------------

Thanks.

-- ---------------------------------------------
Article posted with Web Developer's USENET Archive
http://www.1-script.com/forums
no-spam read and post WWW interface to your favorite newsgroup -
comp.infosystem s.www.authoring.html - 14704 messages and counting!
-----------------------------------------------
Aug 26 '05 #1
4 134381
In article <Pe************ *******@fe04.ne ws.easynews.com >,
ju************* *************** @foo.com (justdummy) wrote:
Hi,

I am struggling with a problem for sometimes. I need to display a table in
a html and if the height of the table goes beyond 200 px then a vertical
scrollbar should alone appear without any horizontal scroll bar. If the
height of the table is less than 200 px then no scroll bars should appear.
Here is the html below. I tried to wrap the table around a <div> tag but
its doesn't work out as the scroll bar appear close to the scroll bar of
the page rather than close to the table. Further if the height of the
table is less than 200 px (i.e., with fewer number of rows like just 2
rows) then also the scroll bars appear.

Am I missing anything in this? Or Is there any other better solution to
this? I would appreciate any help to solve this problem. <div style="height:2 00px; overflow:scroll ">
<table cellpadding="0" cellspacing="1" width="800px"> <...> </table>
</div>


Well, this particular table is 800px wide. You will automatically get a
horizontal scroll at less than that. You may have other problems.

leo

--
<http://web0.greatbasin.net/~leo/
Aug 26 '05 #2
justdummy wrote:

<div style="height:2 00px; overflow:scroll ">

Try "overflow: auto".

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Aug 26 '05 #3
Jim Moe wrote:
justdummy wrote:

<div style="height:2 00px; overflow:scroll ">

Try "overflow: auto".

Depending on browser compatibility you might try these rules
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;

Louise
Aug 26 '05 #4

Cross-browser scrolling tbody:
http://www.gtalbot.org/DHTMLSection/ScrollingTBody.html

Gérard
--
remove blah to email me
Aug 26 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1379
by: David Pratt | last post by:
Hi. I am putting together a database application on Zope. I have built a pager for my records (20 per page) but do not want the browser scroll bars to reset to the top of the browser each time the pager is advanced to the previous or next page. The normal behavior is fine for everything but the anchor tags I am using for the pager. ...
3
16525
by: David Rwj Cherry CS2000 | last post by:
is there any way to disable or lock vertical scroll bars on a browser window? im a newbie and i just don't want them to appear on my screen. sometimes they appear on IE but not on mozilla. any ideas would be most appreciated.
3
10202
by: AES/newspost | last post by:
Just been involved with a web site where clicking a button on the main page opened a second (or secondary) window intended to function like a dialog box in Apple GUI jargon. (The primary page was a private nonprofit organization's home page and the secondary window was actually an election ballot.) The secondary window opened smaller than...
1
4938
by: Ted | last post by:
I am trying to return the vertical scroll position of a rich textbox control using Access 2000. It seems to work for the horizontal scroll bar, but not the vertical. Code follows: Option Explicit Private Declare Function GetScrollPos Lib "user32" (ByVal hwnd As Long, ByVal nBar As Long) As Long Private Declare Function GetFocus Lib...
0
3825
by: Sachin | last post by:
How to match the look and feel of vertical scroll bar with the inbuilt vertical scroll bars of some controls like PrintPreviewControl, Rich Text box , etc. Their scroll bars look blue where the vertical scroll bar control looks brown. please guide -- sachin
0
1081
by: Joey | last post by:
Hello friends, somebody knows as adding bars of Vertical and horizontal displacement to a picture where I have a big image that he/she doesn't enter in the form. Greetings and thank you. -- Ceci est une signature automatique de MesNews. Site : http://www.mesnews.net
1
6493
by: Karl | last post by:
I have a A2000 form that won't show the vertical scroll bar. I have the scroll bar format set to show Both. The horizontal bar works fine. I tried settting the format to show vertical only and it still doesn't show. (it should show as I can only see about half the screen and can't get to the bottom half)
4
22130
by: Matthew Cox | last post by:
Hi, I've been searching the net all day today trying to figure out how one would accomplish what I originally thought would be a fairly straight forward and simple thing. The problem I'm trying to solve is that the designer would like to limit the total number of entires shown when you click on the drop-down arrow of a select box. I'm...
4
4971
by: simulationguy | last post by:
Any of you run into this, i have tried setting the properties of the form to vertical scroll bars only and both neither seems to work. The horizontal scroll bar works fine but its a long form and I cant scroll or page down or anything to get to all of the fields. Works fine in design mode but not form view
0
7896
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7827
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8184
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8195
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5375
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3820
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1434
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.