Advanced Search

Results 1 to 9 of 9

Thread: print stylesheet, table colgroup, text clipping problem

  1. #1
    Join Date
    May 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile 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.

  2. #2
    Join Date
    May 2008
    Posts
    144
    Thanks
    6
    Thanked 11 Times in 11 Posts

    Default

    have you tried removing overflow? its worth a shot

  3. #3
    Join Date
    May 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes i have. did not do much.

  4. #4
    Join Date
    May 2008
    Posts
    144
    Thanks
    6
    Thanked 11 Times in 11 Posts

    Default

    maybe "height: auto"?

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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.

  6. #6
    Join Date
    May 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  7. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Can you post the HTML of the section in question (or a representative part of it, at least)?

  8. #8
    Join Date
    May 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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>

  9. #9
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •