Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5175

listbox: column width not working when specified via CSS


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    •, 9.6.2
    • Components
    • None

      Steps to Reproduce

      When a column width is specified via CSS (use-case: different styles / width for columns depending on selected theme) it's not working properly.

      A short sample to show the issue has been created on zk-fiddle: https://zkfiddle.org/sample/3sq9u66/1-listbox-column-width-via-css-sample

      Here is the code:

      <zk xmlns:n="native">
        <window border="normal" title="hello">
            .themeSpecificColWidth {
            	width: 60px;
          </style>    Sample with header with set via 'width'-Attribute:
                <listheader width="60px">header2</listheader>
          Sample with header with set via CSS:
                <listheader class="themeSpecificColWidth">header2</listheader>
          </listbox>  </window>

      In this sample there are two listboxes:

      • On the first listbox the column with of the 2nd column is specified via the 'width' attribute on the listheader. It works as expected and is the reference
      • On the 2nd listbox the column with of the 2nd column is specified via a css style. The css only seems to affect the listbox header, but not the data rows. They are not aligend with the header

      Current Result

      As you can see the width is only applied to the header, but not to the data ('col2' is not aligned to 'header2')


      Expected Result

      In this sample we see col2 aligned to header2


      Debug Information



       Any ideas's?

            hawk hawk
            christian christian
            0 Vote for this issue
            2 Start watching this issue