Page 1 of 1

Force a fixed column width in AppGini 5.20

Posted: 2013-10-30 04:39
by a.gneady
You might have noticed when using AppGini 5.20 that in the table view, column widths are dynamic ... they get wider on large screens and narrower on small/mobile screens .. this is due to the responsive nature of Bootstrap themes ... but what if you want to force a specific column to retain a fixed width regardless of screen size?

In the generated "dynamic.css.php" file, add a CSS rule similar to this:

Code: Select all

.tablename-fieldname{ max-width: 300px; min-width: 300px; }
For example, if your table is named "orders", and field is "order_date", you can fix the width to 250px like this:

Code: Select all

.orders-order_date{ max-width: 250px; min-width: 250px; }

Re: Force a fixed column width in AppGini 5.20

Posted: 2013-10-30 10:16
by pgkounelas
How to wrap the text in this case.

Re: Force a fixed column width in AppGini 5.20

Posted: 2013-11-11 02:43
by a.gneady
pgkounelas wrote:How to wrap the text in this case.
Try this:

Code: Select all

.orders-order_date{ max-width: 250px; min-width: 250px; white-space: normal !important; }

Re: Force a fixed column width in AppGini 5.20

Posted: 2015-10-01 00:33
by dragon
In addition to what was said above you can also truncate the text in the cell by using this:

Code: Select all

white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

Re: Force a fixed column width in AppGini 5.20

Posted: 2017-03-18 06:42
by thetoolwiz
In AppGini 5.60, my dynamic.css.php file contains a bunch of lines that look like this:

.Passengers-Name{ white-space: normal !important; max-width: 150px !important; min-width: 150px !important; overflow: hidden; }

The actual widths vary, because I set these up in the column-width spec, which seems to only apply to table view, not detail view.

Why don't these also apply to detail view fields as well? If you can specify for one, why not both?

Besides, the table view will typically be viewed in landscape mode, while the detail view will be viewed in portrait mode. At least, this is how I do things. So I'd set the widths differently for table and detail views anyway.