-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Define column widths on both Col and TableList component #129
Comments
@johnfercher do you think this one is hard to solve? |
I think this is a very good feature, but we have to analyze the possibilities first. These are my thoughts about it.
This is the first thing you should see, this code is used in many places to calc the width of the cells. Maybe this will have to consider the actual width value of each col. Lines 29 to 33 in 09beb58
|
My first thought was to work with percentage to handle the amount of columns not overriding page width. But I think the idea of working with a 12-col grid is better, as it also is in line with bootstrap. I think this should be a new Col component because I think the value of the current is still very high and good for most cases. I will try implement this and ask you for help if I get stuck on something. 😄 |
Nice, it must be a Col feature. But you will need to change the code above (GetWidthPerCol). |
Is your feature request related to a problem? Please describe.
I think you should have the possibility to change the width of the columns, especially in the TableList component. When you many column in the list, some may just contain one character and some might have a lot of information. It makes no sense that the column with one character should take as big of a space like the one with a lot of information and get cropped to a new line. Instead we should be able to manage this a bit to free up more space for the ones needed.
Describe the solution you'd like
Maroto should be able to specify not only height, but also width like so:
m.Col(20,19, func() {})
The TableList should maybe have a slice of float64 in the TableProps defining each columns width.
Describe alternatives you've considered
Add additional but optional extra parameter / rewrite to a struct for the Col component to take in.
Add extra struct field called ColSizes that is of type []float64 that holds the size of the columns.
The text was updated successfully, but these errors were encountered: