File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/gitbook/src/components/DocumentView/Table Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ import { FileIcon } from '../FileIcon';
2222import type { TableRecordKV } from './Table' ;
2323import { type VerticalAlignment , getColumnAlignment } from './utils' ;
2424
25+ const alignmentMap : Record < 'text-left' | 'text-center' | 'text-right' , string > = {
26+ 'text-left' : '[&_*]:text-left text-left' ,
27+ 'text-center' : '[&_*]:text-center text-center' ,
28+ 'text-right' : '[&_*]:text-right text-right' ,
29+ } ;
30+
2531/**
2632 * Render the value for a column in a record.
2733 */
@@ -116,7 +122,7 @@ export async function RecordColumnValue<Tag extends React.ElementType = 'div'>(
116122 }
117123
118124 const horizontalAlignment = getColumnAlignment ( definition ) ;
119- const childrenHorizontalAlignment = `[&_*]: ${ horizontalAlignment } ` ;
125+ const horizontalClasses = alignmentMap [ horizontalAlignment ] ;
120126
121127 return (
122128 < Blocks
@@ -131,8 +137,7 @@ export async function RecordColumnValue<Tag extends React.ElementType = 'div'>(
131137 'lg:space-y-3' ,
132138 'leading-normal' ,
133139 verticalAlignment ,
134- horizontalAlignment ,
135- childrenHorizontalAlignment ,
140+ horizontalClasses ,
136141 ] }
137142 context = { context }
138143 blockStyle = { [ 'w-full' , 'max-w-[unset]' ] }
You can’t perform that action at this time.
0 commit comments