Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Commit 7510a28

Browse files
committed
CJPM-17497: added alignment to DataTable Column.
1 parent c0abedd commit 7510a28

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • packages/visual-stack/src/components/Table/DataTable

packages/visual-stack/src/components/Table/DataTable/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ const generateHeader = (
2626
tableProps,
2727
) => {
2828
const { sortable, sortingOption, onSort, data } = tableProps;
29-
const { label: currentLabel, width } = column;
29+
const { label: currentLabel, width, alignment } = column;
3030
const isCurrentColumnSorted = () => {
3131
return sortingOption.label === currentLabel;
3232
};
3333

34+
const right = alignment === 'right' ? alignment : '';
35+
const center = alignment === 'center' ? alignment : '';
36+
3437
const headerClickHandler = () => {
3538
const { order } = sortingOption;
3639
const currentOrder = isCurrentColumnSorted() ? order : null;
@@ -47,6 +50,8 @@ const generateHeader = (
4750

4851
return (
4952
<Th
53+
right={right}
54+
center={center}
5055
id="label"
5156
style={width && { width }}
5257
className={`

0 commit comments

Comments
 (0)