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?
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.
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).
-
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.
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.
I hope this helps.
Let me know if you have any additional questions. Thank you.
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:
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 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.
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?
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.
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).
-
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.
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.
I hope this helps.
Let me know if you have any additional questions. Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
I'm not allowing editing and I don't see a multiline column type offered. Only String.
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.
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
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
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');
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:
I pasted into the form the exact following text which contains a line break:
Line 1
Line 2
I then started to create a wpDataTable and used the following sql:
As you can see, the line break is not applied.
...and the same query in phpMyAdmin shows the line break:
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
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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