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

Tableize AutoDetect Column Width #9

Open
vgkids opened this issue Oct 6, 2018 · 0 comments
Open

Tableize AutoDetect Column Width #9

vgkids opened this issue Oct 6, 2018 · 0 comments

Comments

@vgkids
Copy link
Contributor

vgkids commented Oct 6, 2018

By using the same column width for all columns, two things happen:

  1. If the width is too narrow, long values crash into each other, pushing the column out of shape
email               first_name          id                  last_name           role                warehouse_id        customer_ids        
[email protected]              1100                Stehr               admin                                   []                  
[email protected]            1101                Erdman              manager             1                   []                  
[email protected]              1102                McCullough          staff               1                   []                  
[email protected]               1103                Will                manager             2                   []                  
[email protected]                 1104                Rau                 staff               2                   []                  
[email protected]            1105                Homenick            manager             3                   []                  
[email protected]             1106                Ryan                staff               3                   []                  
[email protected]               1107                Keeling             manager             4                   []                  
[email protected]               1108                Tillman             staff               4                   []                  
[email protected]              1109                Morissette          manager             5                   []                  
[email protected]                1110                Jerde               staff               5                   []                  
[email protected]              1111                Parisian            customer                                [1000]              
[email protected]            1112                Friesen             customer                                [1001]              
[email protected]                1113                O'Connell           customer                                [1002]              
[email protected]             1114                Schmeler            customer                                [1003]              
  1. Setting the column wide enough for the widest column makes the narrow columns take up too much white space:
email                                     first_name                                id                                        last_name                                 role                                      warehouse_id                              customer_ids                              
[email protected]                     Carley                                    1100                                      Stehr                                     admin                                                                               []                                        
[email protected]         Laurence                                  1101                                      Erdman                                    manager                                   1                                         []                                        
[email protected]           Mathew                                    1102                                      McCullough                                staff                                     1                                         []                                        
[email protected]     Maude                                     1103                                      Will                                      manager                                   2                                         []                                        
[email protected]       Sid                                       1104                                      Rau                                       staff                                     2                                         []                                        
[email protected]            Immanuel                                  1105                                      Homenick                                  manager                                   3                                         []                                        
[email protected]              Candice                                   1106                                      Ryan                                      staff                                     3                                         []                                        
[email protected]         Aliza                                     1107                                      Keeling                                   manager                                   4                                         []                                        
[email protected]           Orion                                     1108                                      Tillman                                   staff                                     4                                         []                                        
[email protected]           Simeon                                    1109                                      Morissette                                manager                                   5                                         []                                        
[email protected]             Lori                                      1110                                      Jerde                                     staff                                     5                                         []                                        
[email protected]                 Gussie                                    1111                                      Parisian                                  customer                                                                            [1000]                                    
[email protected]                 Savannah                                  1112                                      Friesen                                   customer                                                                            [1001]                                    
[email protected]                 Jack                                      1113                                      O'Connell                                 customer                                                                            [1002]                                    
[email protected]                 Orlando                                   1114                                      Schmeler                                  customer                                                                            [1003]                                    

The solution is to detect the widest value, and use that plus padding for the column width.

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

1 participant