Log in

View Full Version : print stylesheet, table colgroup, text clipping problem



purplemonkey
05-22-2008, 02:27 PM
hello,
i am displaying a large table with data that has column widths defined using colgroup element.
my problem is that the text in cells is cut off when the print css is applied

reason for print css:
since COL elements are defined with #px widths, the table does not fit on the page horizontally

so i created the following print stylesheet:
table, td, th, div, td div {
width: auto !important; overflow: visible !important; font-size: 9px !important;
}

this does the intended job of making all the columns autofit, and the table fits on the page perfectly.
however, the text inside of the cells is now cut as if overflow was set to hidden. i am guessing that since COL elements are now set to width:auto, they no longer care about expanding to show all the text necessary.

i cannot get rid of colgroup element because this is a 3rd party server control that we implemented.

thenajsays
05-22-2008, 02:38 PM
have you tried removing overflow? its worth a shot

purplemonkey
05-22-2008, 03:00 PM
yes i have. did not do much.

thenajsays
05-22-2008, 03:11 PM
maybe "height: auto"?

Medyman
05-22-2008, 03:45 PM
Have you tried removing the other stylesheets (or setting them to media="screen") to see if there are any conflicts with other CSS styles?

That might be a first step. Get it working by itself and then add on the rest of the page.

If that doesn't work, post a link to your page so we can have a look.

purplemonkey
05-22-2008, 10:50 PM
even with all other stylesheets removed, i still get the clipping problem.

the only css defined for this page is the print stylesheet:

table, td, th, div, td div {
width: auto !important; overflow: visible !important; font-size: 9px !important; font-family: Arial;
}

something to do with colgroup :/
it is as if colgroup cannot exist w/out explicit width set?

Medyman
05-22-2008, 11:15 PM
Can you post the HTML of the section in question (or a representative part of it, at least)?

purplemonkey
05-23-2008, 10:17 PM
sure,
here is the table definition, along with colgroup definition.
sorry about the formatting, but it is generated by a control

<table border='0' cellpadding='0' cellspacing='0' id='ctl00xContentPlaceHolder1xPositionsGrid_main' style="overflow:hidden;position:relative;border-color:#BBBBBB;border-style:Solid;border-width:1px;" class="Webgrid-FrameStyle" onmousemove="igtblro_tableMouseMove(event,'ctl00xContentPlaceHolder1xPositionsGrid');" onmouseup="igtblro_tableMouseUp(event,'ctl00xContentPlaceHolder1xPositionsGrid');"><tr style=""><td align='left' style="vertical-align:top;"><div id="ctl00xContentPlaceHolder1xPositionsGrid_div" style="position:relative;overflow:hidden;overflow-y:auto;width:100%;" tabIndexPage='0' hideFocus='true'><table id='G_ctl00xContentPlaceHolder1xPositionsGrid' bandNo='0' border='0' cellpadding='0' cellspacing='0' style='table-layout:fixed;width:1150px;height:100%;position:relative;'>

<colgroup><col width='65px' /><col width='140px' /><col width='35px' /><col width='58px' /><col width='50px' /><col width='90px' /><col width='90px' /><col width='58px' /><col width='60px' /><col width='90px' /><col width='90px' /><col width='70px' /><col width='60px' /><col width='55px' /><col width='80px' /><col width='59px' /><col width='1px' style='display:none;' /><col width='1px' style='display:none;' /><col width='1px' style='display:none;' /><col width='1px' style='display:none;' /></colgroup>

Medyman
05-27-2008, 02:28 PM
Are the col widths automatically generated too? If not, that's your problem. No matter how you define the width of the colgroup, the individual colums are going to maintain the set widths.