how to set results table column width?

egurevich

Member
I am having trouble setting the column width in my results table and have it stay that way. The columns keep resizing themselves depending on how much text gets displayed in each field. It also seems to vary from browser to browser, because the width is not specified in the <TD> tags in the results table. Is there a way to set a specific width for each column so regardless of the contents of the cell it would remain that width?
 

DebbieS

DaDaBIK Guru
Play around with the word wrap options in config.php. There are several posts on the forum related to word_wrap, column width, etc. Do a search for some of these terms to get additional posts related to the same issue.

 

egurevich

Member
ok I played around with the word_wrap settings in config.php. I still have 2 problems with it.

1) It does not work with the new text type that I created text_right_justified. It looks like I need to add it to the display mode called plain_text, but I can't find where I need to do that. Please point me to the right code.

2) The other problem is that when I turn word_wrap on it resizes all text columns to the same size. However I don't want that to happen. I want to leave some of the columns with their default width, because they have only a short integer in them or a short text of the same character length in all fields, and setting word_wrap on makes them too wide. How can I set some columns to ignore the word_wrap setting?

Thanks
Eli
 

egurevich

Member
ok I solved problem #2. I needed to do the following in config.php.

1) $word_wrap_col had to be set to a smaller value, in my case 15. This forced all fields that have a lot of text in them to be shortened to a specific width.

2) $word_wrap_fix_width had to be set to 0 and not 1. This allowed the columns that had only a few characters in them to remain narrow. I originally set it 1 and then it forced all text columns to become wide which is not what I wanted.

I still have problem #1.
 

egurevich

Member
Just posting here the solution for problem #1 from the other thread.

The code in business_logic.php needs to look as follows:

... this one converts new lines to line breaks ...

case "text_right_justified":
if ($display_mode == "results_table") {
$field_to_display = "<SPAN DIR=rtl><div style=\"text-align: right;\">".nl2br(wordwrap($field_value, $word_wrap_col))."</div></SPAN>";
}
else{
$field_to_display = $field_value;
} // end else
break;
 
Top