contao-community-alliance / contao-multicolumnwizard-bundle

Contao 4 Widget - MultiColumnWizard
GNU Lesser General Public License v3.0
12 stars 12 forks source link

Fix misaligned table headers when using hideHead for some columns #103

Closed fritzmg closed 3 years ago

fritzmg commented 3 years ago

If only you only enable hideHead for some of the columns of the MCW widget, the table layout will be broken, since the hidden class on the <th> removes that <th> completely. Example:

The table headers are aligned with the wrong columns, since hideHead is enabled for the first two columns (checkbox and name), but not for the other 3 columns. Since the CSS class hidden is added onto the <th> of these columns, those header table cells are removed completely and thus misaligned.

This PR changes that, so that the hidden class is only added to the child <div> and not the <th> table header cell itself. Additionally it checks whether all column headers are set to hideHead and then renders no <thead> whatsoever.