feat: columns of type number/percent in the table are right-aligned

This commit is contained in:
chenos 2022-04-06 16:06:08 +08:00
parent dd79cb05bf
commit 592b45f5f7
2 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,7 @@ export const ReadPretty: React.FC<InputProps & InputNumberProps> = (props: any)
} }
const precision = Math.max(getNumberPrecision(String(value)), getNumberPrecision(step)); const precision = Math.max(getNumberPrecision(String(value)), getNumberPrecision(step));
return ( return (
<div> <div className={'nb-read-pretty-input-number'}>
{addonBefore} {addonBefore}
{toFixed(String(value), '.', precision)} {toFixed(String(value), '.', precision)}
{addonAfter} {addonAfter}

View File

@ -100,6 +100,9 @@ export const components = {
css` css`
max-width: 300px; max-width: 300px;
white-space: nowrap; white-space: nowrap;
.nb-read-pretty-input-number {
text-align: right;
}
`, `,
)} )}
/> />