You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`align`|`"left" \| "center" \| "right"`|`"left"`| Horizontal alignment to use for all columns. |
76
76
|`columns`|`Array<string \| ColumnDescriptor>`| - | Array of [column descriptors](#optionscolumns). |
77
+
|`countAnsiEscapeCodes`|`boolean`|`false`| Whether to count ANSI escape codes when calculating string width. |
77
78
|`headerCase`|`"preserve" \| ...`|`"sentenceCase"`| Casing to use for headers derived from input object keys ([read more](#optionsheadercase)). |
78
79
|`lineBreakStrategy`|`"preserve" \| "strip" \| "truncate"`|`"preserve"`| What to do when cell content contains line breaks. |
79
80
|`lineEnding`|`string`|`"\n"`| String used at end-of-line. |
@@ -169,6 +170,31 @@ tablemark(
169
170
| Lee | 23 | true |
170
171
<!-- prettier-ignore-end -->
171
172
173
+
### `options.countAnsiEscapeCodes`
174
+
175
+
Control whether to count ANSI escape codes when calculating string width. The default is `false`, meaning ANSI codes are ignored. Setting this to `true` is useful when the output is not intended for a terminal, such as when generating a markdown table for an example in a README file.
0 commit comments