Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3364440
Displaying line breaks in text cells
Closed

Comments

  • TonyF started the conversation

    I have a table created where Multi-line text is being extracted from the SQL database and placed in a table cell but the text display for that cell does not enforce the line breaks.  These are CRLF ASCII characters so I would expect them to display as line breaks.

    I cannot find any data or style setting to control CRLF display.

    If the exact same SQL query that generates the wpDataTable is executed in phpMyAdmin, the line breaks are noticeable.

    How do I get the line breaks active in a string cell?


  •  1,692
    Miloš replied

    Hi, TonyF.

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    I will explain how adding new lines in our plugin can be done with the current capabilities.

    -

    1. If you use a 'multi-line String' column with a 'multi-line Editor' input type.

    So, if this is a Manual table, or Imported table from a file,  during table generation you will be able to choose for each column which type it will be.

    8853134963.png

    If you set the column from the start as a "multi-line String" , it gets saved in your database as "TEXT";

    then you can use 'multi-line Editor',

     and with combination of "shift+ENTER" you will be able to make new lines like that, 

    without the need for <br> HTML tags.

    ( If you already made the column as one-line string, you can go do the database, find this table and change the column type from VARCHAR to TEXT,  which is a multi-line string).

    1901578003.png

    -

    2.  Another way can be to use a "HTML Editor" , and there you can just press "Enter" for new lines.

    In HTML Editor you can just press "Enter" and it makes new lines, while in the background code it creates HTML markup, with paragraphs.

    6668406850.png
    8563179518.png
    6632989961.png

    3. And finally, if you use Simple Tables, there you can use HTML Editor as well, for making new lines with "Enter", 

    and it adds custom HTML in the cell, but it renders only the text in the cell.

    6322744217.png

    7382717529.png

    1068235837.png

    I hope this helps.

    Let me know if you have any additional questions. Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • TonyF replied

    I'm not allowing editing and I don't see a multiline column type offered.  Only String.

    7148630340.png

    The user supplies the multiline data as a paste into a form field and I don't want to require any editing to insert <br>

    I did discover a workaround by making the form field a rich text box and making it 'visual' not text.

  •  1,692
    Miloš replied

    Hi, TonyF.

    Our apologies once again for all the waiting time.

    We did a lot of testing with our QA Team,

    and unfortunately at this time those are the only ways to get new lines in our plugin's tables,

    if you have editable tables;

    or if the tables are non-editable, or non-server-side in other words,

    such as tables linked to source data,

     for example if you use any of our add-ons to connect a source Form to output a table,

    if the table does not output new lines coming from the Form, you can only try to change the type of Field in the Form,

    if that does not work - then we have to use the HTML <br> tags to make new lines.

    We do realise that it is not convenient to do this, of course.

    -

    If i understood, you made a workaround by changing the form field type to a rich text box and making it 'visual' not text?

    Could you show us a bit more details, just to note for other users who might experience the same issue/use-case,

    and if you can let me know what is the Form Plugin for the data source,

    is it with one of our native built-in Form add-ons,  or perhaps you are pulling the data through a custom SQL Query?

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • TonyF replied

    The Form Plugin for the data source is Formidable Forms.  The user pastes text containing the new lines  into a Rich text field and then submits into the database.  Here I have the rich text field forced to Visual and not text and I hide the toolbar with some php:

    // hide rich text box toolbar
    function hide_toolbar_TinyMCE( $in ) {
            $in['toolbar1'] = '';
            $in['toolbar2'] = '';
            $in['toolbar'] = false;
            return $in; 
        }
        add_filter( 'tiny_mce_before_init', 'hide_toolbar_TinyMCE' );

    and some more php to hide the quicktags:

    function my_editor_settings($settings) {
        $settings['quicktags'] = false;
        return $settings;
        }

    add_filter('wp_editor_settings', 'my_editor_settings');

    6801473503.png


    I'm using a complicated SQL query to populate the wpdatatable but the query is not the issue, as I said, the exact same query executed in phpMyAdmin results in noticeable line breaks.

    -----------------------------------------------------------------------------------------------------------------------------------------

    To simplify things for this description, for an example, I created the following Formidable Form using a Paragraph Field:

    7335475958.png

    I pasted into the form the exact following text which contains a line break:

    Line 1
    Line 2

    9585586737.png

    I then started to create a wpDataTable and used the following sql:

    7508072332.png

    As you can see, the line break is not applied.

    ...and the same query in phpMyAdmin shows the line break:

    3327213723.png



  •  1,692
    Miloš replied


    Hi, Tony.

    Thank you for passing these details to us.

    We will pass this to our developers as i hope it might help them to work on future improvements.

    -

    I understand where you're coming from, and i see that when you run your Query in PHPMyAdmin, it does return the new lines as you need them.

    But our plugin is not the same as a Database Management Tool and is not meant to be used as one.

    Everything in our plugin's SQL feature runs through an PHP & SQL Parser, which has certain limitations,

    amongst them is the way it processes new lines from the data source, unfortunately.

    So, for the time being, we do not have a working solution for this use-case without going into custom work which is not what our support can cover.

    I see that you certainly have coding skills and i hope that you devised a workaround solution for your use-case,

    our devs will work on making improvements to make this easier in the future.

    If you have an idea/suggestion how we might improve this or to describe what is needed,

    you can also write a development suggestion from your end.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables