No announcement yet.

Text align and line wrap in grid column

  • Filter
  • Time
  • Show
Clear All
new posts

  • Text align and line wrap in grid column


    I am dealing two problems in this design:
    1. The content of column "Descripción" is not aligned in the left even it was set at the field's properties.
    2. The content of column "Descripción" is taking the whole screen's width.. and more! to display the text, see how the horizontal scroll bar appears at the bottom.

    For problem 1: I do not know what more to do, the text simply keeps its center alignment
    For problem 2: I do not know how to wrap the text, so if the text reaches the width of the table then breaks it into a new line.

    Thank you in advance.

  • #2
    I too have these problems with alignments in some grids.

    For issue #2 you should be able to set the field to wrap text: Fields -> [FieldName] -> Display settings -> Line Break.
    Did you do that?
    Last edited by robydago; 03-18-2016, 01:43 PM.


    • #3
      Hello robydago,
      Yes, I did it testing both options.. no success.


      • #4
        Hi I have also been facing the same issue and here is the trick I use to over come the above issue. Place the following in the onLoad event of the Grid

        echo "
        .css_to_name_label {vertical-align: top;text-align: left;}
        .css_to_name_grid_line {vertical-align: top;text-align: left;}

        The first line is the Title for the field name to_name and second line is for the content of the field. SC creates different classes based on the field name so you can do by field level

        If you want to apply the same formatting to all the title and fields (if you are using 8.x version then) you can use the below

        echo "
        .scGridLabelFont {vertical-align: top;text-align: left;}
        .scGridFieldOddFont {vertical-align: top;text-align: left;}
        .scGridFieldEvenFont {vertical-align: top;text-align: left;}

        The first line is for the Title and second is for Odd lines and third one is for even lines

        Hope this helps



        • #5

          If you changed the field to be left aligned in its properties and its still not left aligned.
          Clear your browsers cookies. Sometimes style changes made in the settings don't take effect immediately. This has worked for me 100% of the time.



          • #6
            The moment you realize you have been struggling with something for months, and the solution was so simple....

            I have spent hours modifying code because the grids aligned as they pleased, instead of as defined in the scriptcase configuration.. and I never understood why suddenly things worked as they should some time later.

            Thank you Jaques.