Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

How to align item to right #126

Open
ghost opened this issue Jul 13, 2020 · 0 comments
Open

How to align item to right #126

ghost opened this issue Jul 13, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 13, 2020

Screenshot at Jul 13 20-48-45

I'm trying to align the rows of the table to right. Nothing I tried works. When I remove flexArr the rows get lost. How can I align them right?


               <Table>
                    <TableWrapper style={styles.tableWrapper}>
                      <Col
                        data= {[t('sale.discount'), t('sale.subtotal'), t('sale.tax'),t('sale.total')]}
                        flexArr={[2]}  style={styles.tableTitle} heightArr={[28,28]} textStyle={styles.tableTitleText}
                      />
                      <Rows data={[
                        [serializeDecimal(values.discount, 'currencytext')],
                        [serializeDecimal(values.subtotal, 'currencytext')],
                        [serializeDecimal(values.tax, 'currencytext')],
                        [serializeDecimal(values.total, 'currencytext')]
                        ]} flexArr={[3]} style={styles.tableRow} textStyle={styles.tableText}
                      />
                    </TableWrapper>
                  </Table>

  tableWrapper: { flexDirection: 'row', marginLeft: 5,alignItems: 'flex-end' },
  tableTitle: { flex: 1, backgroundColor: '#f6f8fa' },
  tableRow: {  height: 28, flexDirection: 'row', justifyContent: 'flex-end'},
  tableTitleText: { textAlign: 'left' },
  tableText: {flexDirection: 'row', justifyContent: 'flex-end'  }

also tried this way


  tableWrapper: { flexDirection: 'row', marginLeft: 5,alignItems: 'flex-end' },
  tableTitle: { flex: 1, backgroundColor: '#f6f8fa' },
  tableRow: {  height: 28, textAlign: 'right'},
  tableTitleText: { textAlign: 'left' },
  tableText: {textAlign: 'right' }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants