How to avoid line wrap

(10 posts) (4 voices)
  • Started 4 years ago by chadwickhung
  • Latest reply from ziuras

Tags:

No tags yet.

  1. chadwickhung, Member

    I found that some of my result set will automatically line-wrap according to the width of the heading if there are space character in the result, but some won't. How to control it?
    Thanks

    Posted 4 years ago #
  2. nsepetys, Member

    This might be what you are going for...

    SELECT 'dbr.colstyle','columnname','[width: 150px;]'; <-- increase/decrease the width as you see fit

    Posted 4 years ago #
  3. myDBR Team, Key Master

    By default, browsers try to show as much data as possible by doing line-wrap when applicable. You can turn off the line-wrap with CSS white-space property. You can apply the CSS rule to individual column (dbr.colstyle) or to whole result:

    select 'dbr.css', '.nowrap {white-space:nowrap}';
    
    select 'dbr.resultclass', 'nowrap';
    
    select id, data...

    --
    myDBR Team

    Posted 4 years ago #
  4. chadwickhung, Member

    Thanks!

    Posted 4 years ago #
  5. ziuras, Member

    Hi,
    myDBR can you help me with nowrap.

    this example did not work:

    select 'dbr.css', '.nowrap {white-space:nowrap}';
    select 'dbr.resultclass', 'nowrap'; select 1 as errId, 'abcd' + char(13) + char(10) + ' fghe' as errTxt
    union
    select 2 as errId, 'abcd' + char(13) + char(10) + ' fghe' as errTxt
    union
    select 3 as errId, 'abcd' + char(13) + char(10) + ' fghe' as errTxt

    Posted 1 week ago #
  6. myDBR Team, Key Master

    What is the output when you say it does not work? Do you want to show the line breaks or remove them?

    The white-space:nowrap CSS definition collapses white space, but suppresses line breaks (text wrapping) within the source.

    --
    myDBR Team

    Posted 1 week ago #
  7. ziuras, Member

    errId errTxt
    1 abcd fghe
    2 abcd fghe
    3 abcd fghe

    in one line
    i want:
    errId |errTxt
    ---------------
    1 |abcd
    | fghe
    -------------
    2 |abcd
    | fghe
    --------------
    3 |abcd
    | fghe

    Posted 1 week ago #
  8. ziuras, Member

    i want that column errtxt print like:
    "abcd
    ___fghe"

    Posted 1 week ago #
  9. myDBR Team, Key Master

    Hi,
    the 'white-space:nowrap' does exactly the opposite i.e. prevents line wraps.

    To keep the white-spaces (spaces & line feeds), you can use:

    select 'dbr.css', '.nowrap {white-space:pre}';
    
    select 'dbr.resultclass', 'wrap';

    See documentation for white-space from Mozilla.org.

    --
    myDBR Team

    Posted 1 week ago #
  10. ziuras, Member

    thank

    Posted 1 week ago #

Reply

You must log in to post.