NetTalk Central

Author Topic: Hint - making a Browse column wider  (Read 5453 times)

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Hint - making a Browse column wider
« on: September 01, 2015, 06:01:58 PM »
Hint for newbies
In a browse you will see the WIDTH of the column is limited by the words in the header
You might set a display of 30 characters but they all bunch up - see Img (1)
so you add a bunch of white space at the end of the "Name"  and maybe add a full stop to force the Name to be 20 chrs long  like this  -> "Name      ."

But it dont work, multiple spaces are reduced to one space by html

The setting Img (2)  of String 30 chrs only sets how much data is set in the column display

One easy answer to this is to force the column header to be wider by adding spaces that html cannot reduce, these are the 'non breaking space' characters     which you can add to the end of any string to force spaces to be written by html.

Go to you Header tab for the cell  Img (3)   and click to allow xHTML
Then change your Header name from "Name"  to
"Name            "

The result is shown in Img (4)
Hope this helps someone
K

PS - i just needed to tidy up a form so that multiple fields on a line line up. see image two
where same technique is used to position the entry field by adjusting the prompt size

[attachment deleted by admin]
« Last Edit: September 01, 2015, 09:22:51 PM by MyBrainIsFull »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Hint - making a Browse column wider
« Reply #1 on: September 01, 2015, 09:55:24 PM »
Hi Kevin,

While your solution is creative, it's not really a great solution in either case. A better option is to use CSS to achieve what you are wanting to achieve. This has the added benefit of separating content from appearance, which is a good thing.

The width of a column in a browse is not determined by the length of the header. Rather it is determined by the css of that column. For example adding the property white-space: nowrap
to a cell causes the text not to wrap. (there's a class nt-nowrap which exists for this purpose)
to a browse cell means the contents of that cell won't wrap. Setting a min-width would make sure the column only wraps after a certain width and so on.

Likewise, to line up the columns in the form (where you are spanning the prompt and values) you can add a width, or better yet a min-width to the prompt.

In general whenever you are faced with a _visual_ question, then the correct answer usually lies in CSS, not in manipulating the content. I've found that literally typing questions into google with regard to css gives extraordinarily good results.

Cheers
Bruce