css - Table is forcing width of div in IE -


we have page similar following:

<?xml version="1.0" encoding="iso-8859-1"?> <!doctype html public "-//w3c//dtd xhtml 1.1//en"   "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">     <head>         <meta http-equiv="content-type"           content="text/html;charset=iso-8859-1" />         <title>welcome application</title>         <style type="text/css"> html, body, div, table, tr, th, td {     border: 0;     font-family: inherit;     font-size: 100%;     font-style: inherit;     font-weight: inherit;     margin: 0;     padding: 0;     vertical-align: baseline; }  html {     font-size: 100%; }  body {     background: #fff;     color: #036;     font-family: verdana, sans-serif;     font-size: 11px;     line-height: 18px; }  * html body {     text-align: center; }  .container {     display: block;     margin: 18px auto 0;     width: 750px; }  * html .container {     height: 1%;     text-align: left; }  .container:after {     clear: both;     content: "\0020";     display: block;     height: 0;     overflow: hidden;     visibility: hidden; }  .section {     border-color: #e5e5e5 #dbdbdb #d2d2d2;     border-style: solid;     border-width: 1px;     margin-bottom: 18px;     padding: 17px 39px; }  table, th, td {     vertical-align: middle; }  th, td {     border-right: 1px solid #fff;     font-weight: 400;     padding: 9px;     text-align: left; }  table {     border-collapse: separate;     border-spacing: 0;     margin-bottom: 1.4em;     width: 100%; }  th {     background: #c3d9ff;     border-bottom:1px solid #ddd;     font-size: smaller;     font-weight: 700; }         </style>     </head>     <body>         <div class="container">             <div class="section">                 <table cellspacing="0">                     <tr>                         <th>header</th>                         <th>header</th>                         <th>header</th>                     </tr>                     <tr>                         <td>content</td>                         <td>1</td>                         <td>a</td>                     </tr>                     <tr>                         <td>content</td>                         <td>2</td>                         <td>b</td>                     </tr>                     <tr>                         <td>content</td>                         <td>3</td>                         <td>c</td>                     </tr>                     <tr>                         <td>content</td>                         <td>4</td>                         <td>d</td>                     </tr>                     <tr>                         <td>content</td>                         <td>5</td>                         <td>e</td>                     </tr>                     <tr>                         <td>content</td>                         <td>6</td>                         <td>f</td>                     </tr>                 </table>             </div>         </div>     </body> </html> 

the div displays correctly in chrome , firefox 3.6 on windows xp, but, when viewed in ie6, table forcing div wider specified 750 pixels.

this issue has been partially resolved explicitly setting width of table 670 pixels

we'd still prefer resolution width of table doesn't need explicitly defined

i don't have ie6 on computer, though tried simulator @ http://ipinfo.info/netrenderer/ , 1 thing seemed work (short of explicitly setting 670px width on .container or table) add following:

* html .section{     width: 100%; } 

i'm guessing tells ie6 table's setting of width: 100%; should based on .section's computed width (which affected padding , border) instead of .container's width of 750px.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -