-
print stylesheet, table colgroup, text clipping problem
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.
-
-
have you tried removing overflow? its worth a shot
-
-
yes i have. did not do much.
-
-
-
-
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.
-
-
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?
Last edited by purplemonkey; 05-22-2008 at 11:01 PM.
-
-
Can you post the HTML of the section in question (or a representative part of it, at least)?
-
-
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>
-
-
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.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks