From 13c0c0970cac8a51d5b742d25cc979b17828df44 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 8 Mar 2021 22:42:22 +0100 Subject: [PATCH] align action buttons in table to the right --- src/common/table-column.js | 16 ++++++++++------ src/common/table.js | 6 +++++- src/file/edit-files.js | 1 + src/ic/ics.js | 1 + src/scenario/scenario.js | 5 ++++- src/scenario/scenarios.js | 1 + src/user/users.js | 1 + 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/common/table-column.js b/src/common/table-column.js index 2711537..fb9905a 100644 --- a/src/common/table-column.js +++ b/src/common/table-column.js @@ -39,15 +39,19 @@ class TableColumn extends Component { checkboxKey: '', checkboxDisabled: null, labelStyle: null, - labelModifier: null + labelModifier: null, + align: 'left' }; render() { - return ( - - {this.props.title} - - ); + let style = { + textAlign: this.props.align, + width: this.props.width + }; + + return + {this.props.title} + ; } } diff --git a/src/common/table.js b/src/common/table.js index b0a22c4..686d352 100644 --- a/src/common/table.js +++ b/src/common/table.js @@ -250,7 +250,7 @@ class CustomTable extends Component { } return cell; - } // addCell + } static getDerivedStateFromProps(props, state) { const rows = CustomTable.getRows(props); @@ -329,9 +329,13 @@ class CustomTable extends Component { onCellFocus: () => { }, onCellBlur: () => { } }; + let cellStyle = { + textAlign: children[cellIndex].props.align + }; return this.deleteFile(index)} editButton diff --git a/src/ic/ics.js b/src/ic/ics.js index d664107..b0a5016 100644 --- a/src/ic/ics.js +++ b/src/ic/ics.js @@ -445,6 +445,7 @@ class InfrastructureComponents extends Component { {this.state.currentUser.role === "Admin" ? this.isLocalIC(index, ics)} exportButton diff --git a/src/scenario/scenario.js b/src/scenario/scenario.js index 1e9c0c0..90d0586 100644 --- a/src/scenario/scenario.js +++ b/src/scenario/scenario.js @@ -821,6 +821,7 @@ class Scenario extends React.Component { this.downloadResultData(index)} /> this.setState({