mcpeekj
Vendor
- Sep 21, 2001
- 105
I'm having trouble with column widths on a scrolling table not honoring their CSS widths.
Here is the HTML:
And here is the corresponding CSS:
(I know the CSS is kind of a mess with mixed measurements, I'm just trying to get this to work).
So as you can see, I'm fixing the width of the table to 890px, and have column widths adding up to 890px. But none of the columns are actually getting those widths. My "widecolumn"s are varying from 185-213px (regardless of content of the cells) and my "datecolumn" is 120px (making it wrap for long dates). The total width of the table is coming out to 892px.
So, I'm glad it's equaling out to very close to the correct width, but I need the columns to honor the CSS widths. Any thoughts on what's going on?
And I'm refering to IE here (this is a legacy application and doesn't support Firefox at all).
Here is the HTML:
Code:
<div class="tableContainer">
<div class="innerframe" style="max-height: 390px;">
<table cellspacing="0" cellpadding=0 class="datatable">
<thead>
<tr>
<td class="typecolumn">Type</td>
<td class="widecolumn">Alias</td>
<td class="widecolumn">Maps To</td>
<td class="widecolumn">Aggregator</td>
<td class="datecolumn">Modified</td>
<td style="width: 20px;"> </td>
<td style="width: 22px;"> </td>
</tr>
</thead>
<tbody>...
And here is the corresponding CSS:
Code:
.widecolumn {width: 211px;max-width: 211px;min-width: 211px;}
.datecolumn {width:130px;max-width:130px;min-width:130px;}
.typecolumn {width:85px;max-width:85px;min-width:85px;}
.tableContainer {
position: relative; /* to capture the absolutely positioned table header */
padding-top: 19px; /* space for the column heads */
width: 890px;
margin: 0 auto;
background-color: #f5f8fb;
border: solid 1px #b9d3ea;
}
/* this enables the table to scroll without scrolling the page */
.innerframe {
overflow: auto;
width: auto;
max-height: 415px; /* height is required */
background-color: white;
}
/* position the row of column heads above the table */
.tableContainer thead tr {
position: absolute; /* throws the header out of the table */
top: 0px;
left: 0px;
}
.datatable {
border-right: solid 0px #b9d3ea;
width: auto;
/*width: 99%;*/
}
.datatable thead td {
width: 116px; /*Firefox needs this*/
border-bottom:1px solid #b9d3ea !important;
color:#000000;
font-weight:bold;
height:15px;
padding: 2px 3px 3px 4px;
background-color: #f5f8fb;
font-size: 8pt;
}
.datatable td {
margin: 0;
padding: 2px 3px 3px 4px;
height: 20px;
font-size: .9em;
border-bottom:1px solid #b9d3ea !important;
/*width: 125px;*/ /*Firefox needs this*/
}
(I know the CSS is kind of a mess with mixed measurements, I'm just trying to get this to work).
So as you can see, I'm fixing the width of the table to 890px, and have column widths adding up to 890px. But none of the columns are actually getting those widths. My "widecolumn"s are varying from 185-213px (regardless of content of the cells) and my "datecolumn" is 120px (making it wrap for long dates). The total width of the table is coming out to 892px.
So, I'm glad it's equaling out to very close to the correct width, but I need the columns to honor the CSS widths. Any thoughts on what's going on?
And I'm refering to IE here (this is a legacy application and doesn't support Firefox at all).