Repository: primefaces/primefaces (java)

Issue:
DataTable: column footer width doesn't follow column width
### Describe the bug

When migrating Primefaces to version 15 I ran into a problem where the column footer width is different from the column width.

### Reproducer

Here's a sample xhtml and bean:

xhtml:
```
<!DOCTYPE html>
<html lang="pt-BR"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>

</h:head>
<h:body>
    <f:view>
    <div class="ui-fluid card">
        <h:form>
            <div class="p-grid p-col-12">
                <p:dataTable value="#{testWebBean.testDTOs}"
                             var="test"
                             scrollable="true"
                             scrollHeight="400"
                             rowIndexVar="idx"
                             styleClass="ui-datatable-gridlines ui-datatable-striped ui-datatable-sm"
                             reflow="true">
                    <p:column width="5" styleClass="datatable-center">
                        <h:outputText value="#{idx + 1}"/>
                    </p:column>
                    <p:column width="15" styleClass="datatable-center">
                        <f:facet name="header">col 1</f:facet>
                        test
                    </p:column>
                    <p:column width="100">
                        <f:facet name="header">col 2</f:facet>

                        <h:outputText id="value1" value="#{test.value1}" />

                        <f:facet name="footer">
                            <div class="p-grid">
                                <div class="p-col-12 ">
                                    <h:outputText value="some text" />
                                </div>
                                <div class="p-col-12 " style="padding-top: 7px;">
                                    <h:outputText value="some more text" />
                                </div>
                            </div>
                        </f:facet>
                    </p:column>
                    <p:columns id="sub"
                               value="#{testWebBean.subs}"
                               var="sub"
                               width="20"
                               headerText="teste"
                               rendered="true"
                               columnIndexVar="idx2">
                        <f:facet name="header">
                            <div>
                                <h:outputText value="#{idx2 + 1}" />
                            </div>
                            <div>
                                <p:selectBooleanCheckbox />
                            </div>
                        </f:facet>

                        <h:panelGroup>
                            <div>
                                <p:selectBooleanCheckbox value="#{sub.selected}" />
                            </div>
                        </h:panelGroup>

                        <f:facet name="footer">
                            <div class="p-grid">
                                <div class="p-col-12">
                                    <p:selectBooleanCheckbox />
                                </div>
                                <div class="p-col-12" style="padding-top: 8px">
                                    test
                                </div>
                            </div>
                        </f:facet>
                    </p:columns>
                    <p:column headerText="col 3" width="50">
                        <h:outputText value="#{test.value2}" />
                    </p:column>
                </p:dataTable>
            </div>
        </h:form>
    </div>

    </f:view>
</h:body>
</html>
```
bean:
```
import jakarta.annotation.PostConstruct;
import jakarta.inject.Named;
import org.omnifaces.cdi.ViewScoped;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@ViewScoped
@Named("testWebBean")
public class TestWebBean implements Serializable {

    private List<TestDTO> testDTOs = new ArrayList<>();
    private List<TestSubDTO> subs = new ArrayList<>();

    @PostConstruct
    public void init() {
        for (int i=0; i<50; i++) {
            var testDTO = new TestDTO();
            testDTO.setValue1("Test " + i + "-1");
            testDTO.setValue2("Test " + i + "-2");
            testDTOs.add(testDTO);
        }

        subs.add(new TestSubDTO());
        subs.add(new TestSubDTO());
        subs.add(new TestSubDTO());
        subs.add(new TestSubDTO());
        subs.add(new TestSubDTO());
    }

    public List<TestDTO> getTestDTOs() {
        return testDTOs;
    }

    public List<TestSubDTO> getSubs() {
        return subs;
    }

    public class TestDTO implements Serializable {

        private String value1;
        private String value2;

        public String getValue1() {
            return value1;
        }

        public void setValue1(String value1) {
            this.value1 = value1;
        }

        public String getValue2() {
            return value2;
        }

        public void setValue2(String value2) {
            this.value2 = value2;
        }
    }

    public class TestSubDTO implements Serializable {
        private boolean selected;

        public boolean isSelected() {
            return selected;
        }

        public void setSelected(boolean selected) {
            this.selected = selected;
        }
    }
}
```

When using primefaces 11, it looks like this:

![Image](https://github.com/user-attachments/assets/9f8b0a82-76bc-4f9b-814f-c30fbc9c72cd)

But after changing to primefaces 15, it looks like this:

![Image](https://github.com/user-attachments/assets/051d99a5-d61d-42f4-8d7d-5ab51f011c44)

### Expected behavior

The width of the footers should follow the width of the column, just like it did on version 11.

### PrimeFaces edition

None

### PrimeFaces version

15.0.0

### Theme

Poseidon

### JSF implementation

Mojarra

### JSF version

4.0.1

### Java version

21

### Browser(s)

_No response_

Pull request description:
Fix #13645: 15.0.4 Datatable footer missing width styling
Fix #13645: 15.0.4 Datatable footer missing width styling

Patch:
diff --git a/pom.xml b/pom.xml
index c1ca047181..0c75286f45 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
     <groupId>org.primefaces</groupId>
     <artifactId>primefaces-parent</artifactId>
     <packaging>pom</packaging>
-    <version>15.0.3</version>
+    <version>15.0.4-SNAPSHOT</version>
 
     <name>PrimeFaces Parent</name>
     <url>https://www.primefaces.org</url>
diff --git a/primefaces-cli/pom.xml b/primefaces-cli/pom.xml
index 04e9c982d0..7c7527769b 100644
--- a/primefaces-cli/pom.xml
+++ b/primefaces-cli/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-coverage/pom.xml b/primefaces-coverage/pom.xml
index 3678e23f8b..2f48feaba4 100644
--- a/primefaces-coverage/pom.xml
+++ b/primefaces-coverage/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-selenium/pom.xml b/primefaces-selenium/pom.xml
index d21af2e7d9..5c37086ed4 100644
--- a/primefaces-selenium/pom.xml
+++ b/primefaces-selenium/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-selenium/primefaces-selenium-components/pom.xml b/primefaces-selenium/primefaces-selenium-components/pom.xml
index 8caafc70b0..c6feb19e4a 100644
--- a/primefaces-selenium/primefaces-selenium-components/pom.xml
+++ b/primefaces-selenium/primefaces-selenium-components/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-selenium</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-selenium/primefaces-selenium-core/pom.xml b/primefaces-selenium/primefaces-selenium-core/pom.xml
index 30e71fc361..81cd1c6995 100644
--- a/primefaces-selenium/primefaces-selenium-core/pom.xml
+++ b/primefaces-selenium/primefaces-selenium-core/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-selenium</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-showcase/pom.xml b/primefaces-showcase/pom.xml
index a4e8febf03..6ac65cbec4 100644
--- a/primefaces-showcase/pom.xml
+++ b/primefaces-showcase/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-themes/pom.xml b/primefaces-themes/pom.xml
index b4a4a16fd1..1ba6f205df 100644
--- a/primefaces-themes/pom.xml
+++ b/primefaces-themes/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>primefaces-themes</artifactId>
diff --git a/primefaces/pom.xml b/primefaces/pom.xml
index e667d1140e..1b1839e6c4 100644
--- a/primefaces/pom.xml
+++ b/primefaces/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java b/primefaces/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java
index f121f0afc8..50b5a9c03e 100644
--- a/primefaces/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java
+++ b/primefaces/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java
@@ -670,23 +670,7 @@ public class DataTableRenderer extends DataRenderer {
             }
         }
 
-        String style = column.getStyle();
-        String width = column.getWidth();
-
-        if (columnMeta != null && columnMeta.getWidth() != null) {
-            width = columnMeta.getWidth();
-        }
-
-        if (width != null) {
-            String unit = endsWithLenghtUnit(width) ? Constants.EMPTY_STRING : "px";
-            if (style != null) {
-                style = style + ";width:" + width + unit;
-            }
-            else {
-                style = "width:" + width + unit;
-            }
-        }
-
+        String style = resolveColumnStyle(columnMeta, column);
         String ariaHeaderLabel = resolveColumnAriaHeaderText(context, column);
         UIComponent component = (column instanceof UIComponent) ? (UIComponent) column : null;
 
@@ -734,6 +718,27 @@ public class DataTableRenderer extends DataRenderer {
         writer.endElement("th");
     }
 
+    protected String resolveColumnStyle(ColumnMeta columnMeta, UIColumn column) {
+        String style = column.getStyle();
+        String width = column.getWidth();
+
+        if (columnMeta != null && columnMeta.getWidth() != null) {
+            width = columnMeta.getWidth();
+        }
+
+        if (width != null) {
+            String unit = endsWithLenghtUnit(width) ? Constants.EMPTY_STRING : "px";
+            if (style != null) {
+                style = style + ";width:" + width + unit;
+            }
+            else {
+                style = "width:" + width + unit;
+            }
+        }
+
+        return style;
+    }
+
     protected String resolveDefaultSortIcon(SortMeta sortMeta) {
         SortOrder sortOrder = sortMeta.getOrder();
         String sortIcon = DataTable.SORTABLE_COLUMN_ICON_CLASS;
@@ -894,7 +899,7 @@ public class DataTableRenderer extends DataRenderer {
         ResponseWriter writer = context.getResponseWriter();
 
         int responsivePriority = column.getResponsivePriority();
-        String style = column.getStyle();
+        String style = resolveColumnStyle(columnMeta, column);
         String styleClass = column.getStyleClass();
         styleClass = styleClass == null ? DataTable.COLUMN_FOOTER_CLASS : DataTable.COLUMN_FOOTER_CLASS + " " + styleClass;
 


Test patch:
diff --git a/primefaces-integration-tests-jakarta/pom.xml b/primefaces-integration-tests-jakarta/pom.xml
index b8d800b17f..e4f7f7e93c 100644
--- a/primefaces-integration-tests-jakarta/pom.xml
+++ b/primefaces-integration-tests-jakarta/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/primefaces-integration-tests/pom.xml b/primefaces-integration-tests/pom.xml
index 47adbda582..9970726144 100644
--- a/primefaces-integration-tests/pom.xml
+++ b/primefaces-integration-tests/pom.xml
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.primefaces</groupId>
         <artifactId>primefaces-parent</artifactId>
-        <version>15.0.3</version>
+        <version>15.0.4-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>