Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6910225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:47:15+00:00 2026-05-27T08:47:15+00:00

The following is a 3 x 3 table: <html> <body style=overflow:hidden;> <style> div.table_div {overflow:scroll;width:378px;height:117px;position:relative;}

  • 0

The following is a 3 x 3 table:

<html>
<body style="overflow:hidden;">
<style>
div.table_div {overflow:scroll;width:378px;height:117px;position:relative;}
table.TheTable {width:361px;height:100px;table-layout:fixed;border-collapse:collapse;border:1px solid #000000;}
td.TheTableColumnCell {text-overflow:ellipsis;overflow:hidden;white-space:nowrap;border:1px solid #000000;}
</style>

<div class="table_div" id="table_div">
<table class="TheTable">
<tr id='firstTr'>
<td class="TheTableColumnCell">&nbsp;</td>
<td class="TheTableColumnCell">&nbsp;</td>
<td class="TheTableColumnCell">&nbsp;</td>
</tr>
<tr>
<td class="TheTableColumnCell">&nbsp;</td>
<td class="TheTableColumnCell">&nbsp;</td>
<td class="TheTableColumnCell">&nbsp;</td>
</tr>
<tr>
<td class="TheTableColumnCell">&nbsp;</td>
<td class="TheTableColumnCell">&nbsp;</td>
<td class="TheTableColumnCell">&nbsp;</td>
</tr>
</table>
</div>

</body>
</html>

Of note:

a) The table width is 361px because: 119px for each cell (119 x 3 = 357). Then add 4px for the four borders.

b) The table height is 100px because: 32px for each cell (32 x 3 = 96). Then add 4px for the four borders.

c) The div tag. For my windows settings, the scrollbar width/height is 17px. This is why you see the div width and height 378px (361 + 17) and 117px (100 + 17). The purpose for the div is in case I actually have to scroll (in my 3×3 example, I don’t really have to).

In summary: This is a 3×3 fixed-width/height table. If you cut-and-paste that code into an html file and open it in your browser, you’ll see the scrollbars, but neither will actually allow you to scroll (because I have the widths/heights set to show everything without scrolling).

The problem:

Do the following:

Instead of making the height of each cell 32px, make them 16px. So, the height for table.TheTable should be changed to 52px (instead of 100px). The height for div.table_div should be changed to 69px (instead of 117px) – again, my scrollbar height is 17px.

The vertical scrollbar, while always visible, now scrolls. I can’t fit everything now? But I thought my calculations were correct? The magic number seems to be 22px. Less than 22px (height) I get a scrollbar that scrolls. Greater than 22px, I get a scrollbar that doesn’t scroll. If the div tag is correctly calculated, the scrollbars shouldn’t scroll. How do I avoid that for heights less than 22px?

EDIT: The overflow:scroll is necessary. I pulled this HTML out of a larger set a code. In the real code the table is much larger. The div tag allows me to show a certain amount of cells, and I can scroll to see the rest. It’s when I started playing with height’s less than 22px, that’s when I discovered the issue. As it messes with some other things I’m trying to do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:47:15+00:00Added an answer on May 27, 2026 at 8:47 am

    Your Problem has now become the font size/line height:

    http://jsfiddle.net/EZ6q2/1/

    You will need to reduce font size:

    http://jsfiddle.net/EZ6q2/2/

    or Line Height
    http://jsfiddle.net/EZ6q2/3/

    In Response To Your Comment

    White space is still content and will count as text on a line. Completely emptying the cell also fixes the problem in Fire Fox. Be wary of this as some browsers my completely collapse empty cells (I’ve experienced this in some older browsers, IE 6 perhaps).

    http://jsfiddle.net/EZ6q2/5/

    A Little More Follow Up

    The “padding” you refer to is the line height. From what I understand from the specs this is determined by metrics contained within the font its self and by default is a proportion of the font size, which is why changing the font size works. Changing the line height gives you an absolute result.

    See this fiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html page: <body> <div class=hide1 style=width:1000px; height:1000px;> <table width=100% border=0
I have the following html code. <html> <body> <div style=max-width:1600px; min-width:900px; > <table> </table>
I have the following html code: <table> <tr> <td> <div id=fixmywidth style=position:relative; height:30px;> <div
I've an HTML page like following: <html> <body> <div id=emaildiv class=main style=width:150px;height:80px;></div> </body> </html>
I have the following HTML: <div style=30px;> <table width=100%;> <tr> <td> <SELECT name=guidelinks> <OPTION
I have the following HTML table: <table style=width: 100%;> <tr> <td class=title_bar_left_border></td> <td class=title_bar_middle></td>
I have the following code: DIV><TABLE><TBODY><TR><TD> <DIV id=namesClass style=WIDTH: 700px> <UL style=MARGIN-LEFT: 0px! important;
I have the following HTML generated by an ASP.NET repeater: <table> <tr> <td><input type=hidden
I have the following CSS: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { background: transparent; border: 0; font-size: 100%; margin:
I have the following html files: <html> <head> <style type=text/css> .table-striped { padding: 0;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.