How to set the column widths

QuestionsHow to set the column widths
Enrique asked 10 years ago

Hello,

I have a grid with more than 15 fields. I would like to see a sample of how to set the width of two or three columns so I can do them all.

Thank you much.

3 Answers
Abu Ghufran answered 10 years ago

$col["width"] will set width of a column.

Refer documentation "Customizing Columns of Grid".

If you want to customize any specific column properties, and let other columns be displayed from table definition, you can pass 2nd argument of `set_columns($cols,true)` to `true`.

$col = array();
$col["name"] = "company";
$col["edittype"] = "textarea";
$col["width"] = "200";
$cols[] = $col;

$g->set_columns($cols,true);

kim answered 10 years ago

custommizing columns of grid.

#1)
i am using the below code to display column title name as 2 lines, BUT
the column height is not adjusting to accomodate multiple lines within a column thus only first text of title displays.
#2)
how to adjust text display of column title names as 1 line on both ADD & EDIT forms
the spacing and formating of text column title names overlay field names.

any clue?

$col["title"] = "Contract<br> Type";

Abu Ghufran answered 10 years ago

The code is correct, however it may be due to other css file conflict.
You can try disabling the external css files.

Another option is to modify conflicting css and check using firebug.

Your Answer

1 + 16 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?