473,320 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

IE7 Does not use min-width to calculate DIV width in a Table

I'm trying to get a list of page links for a report, and I'm running into a problem with IE. I have a group of nested left-floating DIVs for the page menu, inside a table. Firefox expands the size of the table to see the entire menu, but IE does not, the last few are cut off. After a couple of hours of testing, I have determined that IE is not using the min-width when calculating the width of the DIV, but does use the min-width when displaying the nested DIVs. If I remove the min-width all links are visible, and the table's width is exactly the same with and without the min-width. I've looked for a fix for this bug but I have not found anything yet. Here is the relevant code.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  5.     <meta http-equiv="content-language" content="en-us" />
  6.  
  7.     <title>Test</title>
  8.  
  9.     <style type='text/css'>
  10.         .rpt_page_menu{
  11.             border-style: solid;
  12.             border-width:1px;
  13.             background-color:#FF0000;
  14.         }
  15.         /* Common to all */
  16.         .rpt_prev,
  17.         .rpt_number,
  18.         .rpt_next{
  19.             float:left;
  20.             clear:right;
  21.             margin:2px;
  22.         }
  23.         /* Common to all */
  24.         a.rpt_prev_link,
  25.         a.rpt_number_link,
  26.         a.rpt_number_link_active,
  27.         a.rpt_next_link{
  28.             text-decoration:none;
  29.             color:#0000FF;
  30.         }
  31.         .rpt_prev{}
  32.         a.rpt_prev_link{}
  33.         .rpt_number{
  34.             border-style:solid;
  35.             border-width:1px;
  36.             border-color:#666666;
  37.             background-color:#CCCCCC;
  38.             min-width:20px;                /* add and remove this line to see bug */
  39.             padding-left:1px;
  40.             padding-right:1px;    
  41.         }
  42.         a.rpt_number_link{}
  43.         a.rpt_number_link_active{
  44.             font-weight:bold;
  45.             color:#000000;
  46.         }
  47.         .rpt_next{}
  48.         a.rpt_next{}
  49.         .float_fix{
  50.             clear:left;
  51.             height:0px
  52.         }
  53.     </style>
  54. </head>
  55. <body>
  56.  
  57. <table border='1' align='center'><tr><td align='center'>
  58.  
  59. <div class='rpt_page_menu'>
  60.     <div class='rpt_prev'><a class='rpt_prev_link' href=''>&lt;&lt; Prev</a></div>
  61.  
  62.     <div class='rpt_number'><a class='rpt_number_link' href=''>1</a></div>
  63.     <div class='rpt_number'><a class='rpt_number_link_active' href=''>2</a></div>
  64.     <div class='rpt_number'><a class='rpt_number_link' href=''>3</a></div>
  65.     <div class='rpt_number'><a class='rpt_number_link' href=''>4</a></div>
  66.     <div class='rpt_number'><a class='rpt_number_link' href=''>5</a></div>
  67.     <div class='rpt_number'><a class='rpt_number_link' href=''>6</a></div>
  68.     <div class='rpt_number'><a class='rpt_number_link' href=''>7</a></div>
  69.     <div class='rpt_number'><a class='rpt_number_link' href=''>8</a></div>
  70.     <div class='rpt_number'><a class='rpt_number_link' href=''>9</a></div>
  71.     <div class='rpt_number'><a class='rpt_number_link' href=''>10</a></div>
  72.     <div class='rpt_number'><a class='rpt_number_link' href=''>11</a></div>
  73.     <div class='rpt_number'><a class='rpt_number_link' href=''>12</a></div>
  74.     <div class='rpt_number'><a class='rpt_number_link' href=''>13</a></div>
  75.     <div class='rpt_number'><a class='rpt_number_link' href=''>14</a></div>
  76.     <div class='rpt_number'><a class='rpt_number_link' href=''>15</a></div>
  77.     <div class='rpt_number'><a class='rpt_number_link' href=''>16</a></div>
  78.     <div class='rpt_number'><a class='rpt_number_link' href=''>17</a></div>
  79.     <div class='rpt_number'><a class='rpt_number_link' href=''>18</a></div>
  80.  
  81.     <div class='rpt_next'><a class='rpt_next_link' href=''>Next &gt;&gt;</a></div>
  82.  
  83.     <div class='float_fix'>&nbsp;</div>
  84. </div>
  85.  
  86. </td></tr></table>
  87.  
  88. </body>
  89.  
  90. </html>
  91.  
The red background and table border are just for debugging purposes. And the empty CSS classes are just for future expandability.

Any ideas?

(And yes, I realize using the table to center align the div is taking the easy way out, but unless anyone knows of a way to center a dynamic width DIV across all browsers I'm stuck with the table. If I ever find the guy who decided that <div align='center'> means nothing...)
Oct 9 '08 #1
0 1798

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Claudio Grondi | last post by:
Trying to understand the outcome of the recent thread (called later reference thread): "Speed quirk: redundant line gives six-fold speedup" I have put following piece of Python code together:...
3
by: Ker | last post by:
I have a query that works great. It gives me the min for multiple fields. Within this query, I also need to get the max of some fields too. I currently have output of Date Name ...
6
by: R.Biloti | last post by:
Hi I defined two usual macros for max and min: #define max(x,y) ( (x) > (y) ? (x) : (y) )#define min(x,y) ( (x) < (y) ? (x) : (y) ) I need to compute max( x1, min( x2, x3) ). Is it...
3
by: 0to60 | last post by:
Sometimes it does, sometimes it doesn't. It seems to work most when declaring variables, and hitting "::" between namespaces. But when I hit "->" I get the message "Intellisense: no additional...
4
by: jaip26 | last post by:
All, I came across a strange situation in my query. Basically here is the result of my query. col1 col2 col3 col4 col5 col6 col7...
3
by: AZRebelCowgirl73 | last post by:
can anyone help me I cant get this program to run, it errors during bugging! I thought I was pretty close to having it, but I can't get it! thanks! //C++ Project 3: //For your Project 3...
11
by: lovecreatesbea... | last post by:
#define MIN(x, y) ((x)<(y) ? (x):(y)) Can a version without conditional operator of MIN macro be written?
4
by: BoscoPippa | last post by:
Hi all, I'm a rank beginner to C++ and programming in general. I'm in week 6 of my first course, and we have an assignment I'm having a little trouble with. If it matters, we're using standard...
19
by: Eugeny Myunster | last post by:
I know, only simple one: #include <stdio.h> int main() { int min=0,max=0,i,arr; for(i=0;i<12;i++) arr=rand()%31-10; for(i=0;i<12;i++)
16
by: Peng Yu | last post by:
Hi, I'm wondering if there is a min function (in boost, maybe?) that accepts any number of arguments? std::min only accepts two arguments. If I want to get the minimum number out of many, I have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.