Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align price value to the right. #6

Closed
lipis opened this issue May 28, 2016 · 4 comments
Closed

Align price value to the right. #6

lipis opened this issue May 28, 2016 · 4 comments

Comments

@lipis
Copy link

lipis commented May 28, 2016

No description provided.

@eladnava
Copy link
Owner

Hi @lipis, good idea!

I'm thinking it could be an optional value passed in via body.table.columns.align, e.g.:

table: {
            data: [
                {
                    item: 'Node.js',
                    description: 'Event-driven I/O server-side JavaScript environment based on V8.',
                    price: '$10.99'
                },
            ],
            columns: {
                  align: {
                       price: 'right'
                  }
            }
}

Would you like to submit a PR with this improvement?

@lipis
Copy link
Author

lipis commented May 28, 2016

I would not overcomplicate it.. the numbers are usually on the right.. and the titles should be center aligned.. the rest on the left.. too lazy for the PR.. sorry :)

@eladnava
Copy link
Owner

eladnava commented May 28, 2016

I think we should strive to allow as much configurability as possible, no reason to limit it to numbers only. Also, we should support center alignment as well.

Will add this soon.

eladnava added a commit that referenced this issue May 28, 2016
As per #6. Thanks to @lipis for the suggestion!
@eladnava
Copy link
Owner

eladnava commented May 28, 2016

@lipis done, implemented as follows:

      table: {
            data: [
                {
                    item: 'Node.js',
                    description: 'Event-driven I/O server-side JavaScript environment based on V8.',
                    price: '$10.99'
                },
                {
                    item: 'Mailgen',
                    description: 'Programmatically create beautiful e-mails using plain old JavaScript.',
                    price: '$1.99'
                }
            ],
            columns: {
                // Optionally, customize the column widths
                customWidth: {
                    item: '20%',
                    price: '15%'
                },
                // Optionally, change column text alignment
                customAlignment: {
                    price: 'right'
                }
            }
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants