ICEfaces
  1. ICEfaces
  2. ICE-3021

Datatable: displaced table-header when headerRow is used in a scrollable table

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2, 1.7RC1
    • Fix Version/s: 1.7.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      windows 2000 advanced server, tomcat 6.0.16, icefaces 1.7RC1

      Description

      The table header is displaced when headerRow is used in a scrollable table.

      See http://www.icefaces.org/JForum/posts/list/7836.page

        Issue Links

          Activity

          Hide
          Michael Thiem added a comment -

          this really seems to be a bug since when the scrollable attribute is set to false the table renders correctly.

          Show
          Michael Thiem added a comment - this really seems to be a bug since when the scrollable attribute is set to false the table renders correctly.
          Hide
          yip.ng added a comment -

          The alignment problems were caused by bugs in the renderer and bugs in the CSS for the web page. The bugs in the renderer have been fixed, but to achieve proper alignment, you still need to have the proper CSS.

          In a scrollable table, the header is actually a separate table. Therefore, the header cells will get out of alignment if their widths are not set up to match the widths of table content cells. To complicate things further, if the width of the cell contents exceeds the width of a cell, IE will stretch the cell even if the cell's overflow property is set to hidden.

          Here are a few things you should do in the CSS for the table:

          • don't specify the width of the table as a whole; let the cell widths make up the table width
          • the widths in columnWidths should be separated by commas, not semicolons; and they should have px as the length unit
          • if width of cell contents exceeds width of cells, wrap contents in panelGroup with a style like this: width:160px;overflow:hidden
          • if you are using headerRow's, you also need to set header column widths explicitly: <ice:column style="width: 35px;">; you can use the style class iceDatTblColGrpHdrCol instead if all your columns have the same width
          • if you are using headerRow's, be careful with all the rowspans and colspans
          • be sure to match padding and border widths as well

          See screenshot-1 for an example result of proper alignment. It is a scrollable table with headerRow's.

          Show
          yip.ng added a comment - The alignment problems were caused by bugs in the renderer and bugs in the CSS for the web page. The bugs in the renderer have been fixed, but to achieve proper alignment, you still need to have the proper CSS. In a scrollable table, the header is actually a separate table. Therefore, the header cells will get out of alignment if their widths are not set up to match the widths of table content cells. To complicate things further, if the width of the cell contents exceeds the width of a cell, IE will stretch the cell even if the cell's overflow property is set to hidden. Here are a few things you should do in the CSS for the table: don't specify the width of the table as a whole; let the cell widths make up the table width the widths in columnWidths should be separated by commas, not semicolons; and they should have px as the length unit if width of cell contents exceeds width of cells, wrap contents in panelGroup with a style like this: width:160px;overflow:hidden if you are using headerRow's, you also need to set header column widths explicitly: <ice:column style="width: 35px;">; you can use the style class iceDatTblColGrpHdrCol instead if all your columns have the same width if you are using headerRow's, be careful with all the rowspans and colspans be sure to match padding and border widths as well See screenshot-1 for an example result of proper alignment. It is a scrollable table with headerRow's.
          Hide
          David Soul added a comment -

          It would be interesting an example in 1.7.2 component-showcae on how to achieve a complex header with scrollable="true" in a correct form and explain the details to obtain the proper CSS.

          Show
          David Soul added a comment - It would be interesting an example in 1.7.2 component-showcae on how to achieve a complex header with scrollable="true" in a correct form and explain the details to obtain the proper CSS.

            People

            • Assignee:
              Unassigned
              Reporter:
              David Soul
            • Votes:
              14 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: