From 7688d4e4114c05bfa990c835ad7e0c1f81defcd4 Mon Sep 17 00:00:00 2001 From: Pawel Czarnota <114521677+pczarn2@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:01:45 -0500 Subject: [PATCH] Update CreateTable.java 1. Add comments on setName, setDisplayName and set style name lines 2. Remove duplicate lines. Lines above already call setShowColumnStripes and setShowRowStripes methods --- .../apache/poi/examples/xssf/usermodel/CreateTable.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CreateTable.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CreateTable.java index 7e1d56ad000..6a150bc380d 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CreateTable.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CreateTable.java @@ -44,12 +44,12 @@ public static void main(String[] args) throws IOException { // Create XSSFTable table = sheet.createTable(reference); - table.setName("Test"); - table.setDisplayName("Test_Table"); + table.setName("Test"); //no spaces + table.setDisplayName("Test_Table"); //must be different than setName // For now, create the initial style in a low-level way table.getCTTable().addNewTableStyleInfo(); - table.getCTTable().getTableStyleInfo().setName("TableStyleMedium2"); + table.getCTTable().getTableStyleInfo().setName("TableStyleMedium2"); //no spaces // Style the table XSSFTableStyleInfo style = (XSSFTableStyleInfo) table.getStyle(); @@ -58,8 +58,6 @@ public static void main(String[] args) throws IOException { style.setShowRowStripes(true); style.setFirstColumn(false); style.setLastColumn(false); - style.setShowRowStripes(true); - style.setShowColumnStripes(true); // Set the values for the table XSSFRow row;