Get a Jumpstart with our Sample Apps
Results 1 to 11 of 11

Thread: Fixed Grid Column Widths/Row Heights

  1. #1
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default Fixed Grid Column Widths/Row Heights

    The WAS likes to dynamically adjust Column Widths/Row Heights depending upon the field contents. I want to fix the W + H. Seems like this should be a simple setting, but apparently not?

    Is there a way?

  2. #2
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default

    You fix the width of the overall grid under Properties / Table Tag Attributes. Just put in "width=xxx" where xxx is your width in pixels.

    If you added Layout Commands / Tab Control, the width is set under Sizing in the tab control - but this is only the tab area within the overall grid, so it should be set something smaller than your overall grid with.

    Text boxes are set by the Size attribute, lables are set by the Label In-line Style and the Heading Inline Style (need both) otherwise it automatically sets to the size of the heading. Format here is "width: xxx" where xxx is in pixels.

    Height is set here too, format for both is: "height: x; width: x". If you set height for one field, this sets the height for all fields.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  3. #3
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default

    Thanks, Steve. Unfortunately, I have tried that and it does not work. The height still expands and although the width will work for data shorter than the column, longer data cause the column width to expand anyway. I can somewhat control it by using a combination of a trimmed calc field and the width parameter. But even then, it is not perfect, unless I trim the calc field shorther than the column width by trial & error - and even that won't allow me to control the height due to the uncertainty of crlf() in the memo field.

  4. #4
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,608

    Default

    This is an HTML limitation - no matter what you specify for height and width, if they are not large enough for the contecnt then your browser will expand the table cell for you.

    There is no way to avoid this from the design of your grid or HTML, you will need to trim your data if it is crucial that your cells never expand. And even then, you have no control over the fonts being used by your user's browser so they could have things set to be really large and still be larger than the table cell.

    Quote Originally Posted by Peter G.
    Thanks, Steve. Unfortunately, I have tried that and it does not work. The height still expands and although the width will work for data shorter than the column, longer data cause the column width to expand anyway. I can somewhat control it by using a combination of a trimmed calc field and the width parameter. But even then, it is not perfect, unless I trim the calc field shorther than the column width by trial & error - and even that won't allow me to control the height due to the uncertainty of crlf() in the memo field.

  5. #5
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,486

    Default

    Thanks for that clarification, Lenny.

  6. #6
    Member
    Real Name
    Otto Gustafson
    Join Date
    Apr 2006
    Posts
    26

    Default Re: Fixed Grid Column Widths/Row Heights

    Quote Originally Posted by Lenny Forziati View Post
    This is an HTML limitation - no matter what you specify for height and width, if they are not large enough for the contecnt then your browser will expand the table cell for you.

    There is no way to avoid this from the design of your grid or HTML, you will need to trim your data if it is crucial that your cells never expand. And even then, you have no control over the fonts being used by your user's browser so they could have things set to be really large and still be larger than the table cell.
    I also have the issue with height of the grid row (also detail rows). And I am referring not to the field text boxes, but the row area containing the fields.
    When I generate the "live preview" the row heights appear as tight as I would like them, but when publishing and then viewing in the browser the row height is over 50% taller than in live preview, but the data cell/text box height remains the same as it was in live preview. The result is that I use up more monitor real estate (top to bottom) than I would like to.
    The solution must be in the CSS setting; I have tried to adjust by changing CSS settings, but have not discovered the magic setting. I started with the generic Glass Blue. Thank you for any suggestions.

    I have included a side by side example: browser results on the left; live preview on the right.row height - browser vs Live Preview.png

  7. #7
    Member
    Real Name
    Jose Velez
    Join Date
    Oct 2010
    Location
    Dallas, Texas
    Posts
    125

    Default Re: Fixed Grid Column Widths/Row Heights

    This limitation has been beyond frustrating... has anyone found a workaround? This seems like something that should be easy to do.

  8. #8
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,738

    Default Re: Fixed Grid Column Widths/Row Heights

    This is the V7 forum, are you recent posters using V7?

    Otto, study the web view using Firebug to determine what CSS is being applied to cause the extra space (if any), then adjust either in the grid or using page-level CSS. If you toss that grid up on a public page and give me the URL, I can do it for you. GlassBlue is a legacy style, try updating to a more recent style (unless you really are using V7.)

    Jose - which limitation, the one Peter described in the first post and Lenny said was out of Alpha's control and totally dependent on HTML limitations? You can mostly 'defeat' that limitation by truncating your text or using Javascript to dynamically change the font size based on string length (likely not an easy task). As to truncating the text, in the past I have used a function to trim long text to 100 characters and place a "more..." at the end if the string was longer than 100 characters, and the "more..." was a hyperlink to a popup that displayed the full text.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  9. #9
    Member
    Real Name
    Jose Velez
    Join Date
    Oct 2010
    Location
    Dallas, Texas
    Posts
    125

    Default Re: Fixed Grid Column Widths/Row Heights

    Try using the white-space property in the Cell in-line style. I set it to normal and it worked for me.

  10. #10
    Member
    Real Name
    Jose Rodriguez
    Join Date
    Apr 2012
    Posts
    27

    Default Re: Fixed Grid Column Widths/Row Heights

    Quote Originally Posted by Steve Wood View Post
    This is the V7 forum, are you recent posters using V7?

    Otto, study the web view using Firebug to determine what CSS is being applied to cause the extra space (if any), then adjust either in the grid or using page-level CSS. If you toss that grid up on a public page and give me the URL, I can do it for you. GlassBlue is a legacy style, try updating to a more recent style (unless you really are using V7.)

    Jose - which limitation, the one Peter described in the first post and Lenny said was out of Alpha's control and totally dependent on HTML limitations? You can mostly 'defeat' that limitation by truncating your text or using Javascript to dynamically change the font size based on string length (likely not an easy task). As to truncating the text, in the past I have used a function to trim long text to 100 characters and place a "more..." at the end if the string was longer than 100 characters, and the "more..." was a hyperlink to a popup that displayed the full text.
    Hi,

    In which event or where did you place the Javascript to truncate the text and display the hyperlink? I have not been able to truncate the tex without changing the field value.


    Thanks,

    Jose

  11. #11
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,675

    Default Re: Fixed Grid Column Widths/Row Heights

    I was wondering the same thing Steve (about the "more" link) and yeah I am in V12 - far cry from 7 in fact I have never seen v7.
    What I really wanna know is if Steve has a book coming out on all his tips and tricks, lol !!!

Similar Threads

  1. 2nd Row Label on Grid
    By Louis Nickerson in forum Alpha Five Version 6
    Replies: 7
    Last Post: 02-18-2005, 12:37 PM
  2. grid (brows)-> column -> column title
    By alimrb in forum Web Application Server v6
    Replies: 2
    Last Post: 01-06-2005, 05:54 AM
  3. Repeat same info in each row of a column
    By Fred M. Pfeiffer in forum Alpha Five Version 5
    Replies: 1
    Last Post: 05-02-2004, 03:30 PM
  4. Control panel column widths
    By Fred M. Pfeiffer in forum Alpha Five Version 5
    Replies: 3
    Last Post: 11-23-2003, 10:18 AM
  5. Browse row heights?
    By Steve Pick in forum Alpha Five Version 4
    Replies: 1
    Last Post: 03-29-2002, 10:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •