Skip to content

Commit 4c07ed3

Browse files
committed
truncate long table cell text with ellipsis at 192px max width
1 parent 48f2354 commit 4c07ed3

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/HTMLEngineProvider/HTMLRenderers/TableCellRenderer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ function TableCellRenderer({tnode}: CustomRendererProps<TBlock>) {
5252

5353
return (
5454
<View style={[styles.htmlTableCell, cellAlignmentStyle]}>
55-
<Text style={[isHeaderCell ? styles.htmlTableHeaderCellText : styles.htmlTableCellText, textAlignmentStyle]}>
55+
<Text
56+
numberOfLines={1}
57+
style={[isHeaderCell ? styles.htmlTableHeaderCellText : styles.htmlTableCellText, textAlignmentStyle]}
58+
>
5659
<TNodeChildrenRenderer tnode={tnode} />
5760
</Text>
5861
</View>

src/styles/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,7 @@ const staticStyles = (theme: ThemeColors) =>
27322732
htmlTableCell: {
27332733
flex: 1,
27342734
minWidth: variables.htmlTableColumnMinWidth,
2735+
maxWidth: variables.htmlTableColumnMaxWidth,
27352736
paddingEnd: 8,
27362737
},
27372738

src/styles/variables.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export default {
138138
htmlTableRowMinHeight: 40,
139139
htmlTableHeaderRowMinHeight: 30,
140140
htmlTableColumnMinWidth: 120,
141+
htmlTableColumnMaxWidth: 192,
141142
tableGroupRowPaddingVertical: 4,
142143
tableGroupRowHeight: 36,
143144
tableCheckboxColumnWidth: 20,

0 commit comments

Comments
 (0)