@@ -81,7 +81,7 @@ export type CellOptions = Partial<{ colSpan: number, rowSpan: number } & Pick<Ce
81
81
/**
82
82
* Creates and configures a cell within the current worksheet at the current row and column position.
83
83
*
84
- * @param value The value to be placed into the cell. Can be of any type supported by exceljs.
84
+ * @param value The value to be placed into the cell.
85
85
* @param options Optional configuration for the cell.
86
86
* @returns The `exceljs.Cell` object that was created and configured.
87
87
*/
@@ -124,7 +124,7 @@ export function cell(value: any, options: CellOptions = {}) {
124
124
/**
125
125
* Creates a cell object with a thin border applied to all four sides.
126
126
*
127
- * @param value - The value to be placed into the cell. Can be of any type supported by exceljs.
127
+ * @param value - The value to be placed into the cell.
128
128
* @param options - Optional configuration for the cell.
129
129
* @returns The `exceljs.Cell` object that was created and configured.
130
130
*/
@@ -140,6 +140,19 @@ export function borderedCell(value: any, options: CellOptions = {}) {
140
140
} )
141
141
}
142
142
143
+ /**
144
+ * Creates a cell configuration with content centered horizontally and vertically.
145
+ *
146
+ * @param value - The value to be placed into the cell.
147
+ * @param options - Optional configuration for the cell.
148
+ */
149
+ export function centeredCell ( value : any , options : CellOptions = { } ) {
150
+ return borderedCell ( value , {
151
+ alignment : { horizontal : 'center' , vertical : 'middle' } ,
152
+ ...options
153
+ } ) ;
154
+ }
155
+
143
156
const DEFAULT_FONT_SIZE = 11 ;
144
157
const DEFAULT_COL_WIDTH = 8.43 ;
145
158
0 commit comments