Okay
  Public Ticket #3459017
Solution for Line Breaks in HTML -> Excel
Closed

Comments

  •  2
    Debra started the conversation

    I am displaying data in columns where I insert in the MySQL view a <br/> character.  However, in export to Excel, the line break turns into a space.  I need the line break to convert properly.  Can you fix in the plugin or can you give me alternate HTML to write into the MySQL view so I can get line breaks in both areas?

  •  1,708
    Miloš replied

    Hi Debra,

    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 show all the possibilities we currently have to make new lines with our Tables,

    for the tables linked from Excel as well as editable Tables ( SQL based).

    -

    Unfortunately, at this time we don't have an easy solution to pass new lines/line breaks when a table is linked to a source Spreadsheet/CSV/Excel.

    Any formatting we set on the source can not be passed to the table in that way.

    1.  Adding HTML <br> tag in the source sheet cells can do the trick.

    1465539891.png
    3633558667.png

    2.

    The only other workaround can be by using Conditional Formatting, but it is a more complex solution.

    Here is how we can make the values in the cells go into multiple lines;  without having to use any <br> tags.

    -

    if you create values for cells like this example :

    4782946091.png

    And then, if you make conditional rules, like this :

    2919094666.png

    This will make the plugin check, if any cell value is containing those values as we write them > Then it will add <br> to them , to make them go in new lines in the table cells, this is the result:

    3533615901.png

    So, with this kind of a workaround, you would be able to get filter values in the selectbox without <br> tags, and at the same time, you can get column cells in the table, to go multiple lines.

    -

    But, it depends on exactly what kind of content the persons editing the source sheet will be adding to the table.

    This workaround is only useful if we have only several possible values,

    but if you have some long text and it needs a lot of new lines,  in that case, the Conditional Rules workaround is just more difficult , compared to inputting <br> tags.

    -

    At this time that is the best we can do, unfortunately there are no better / easier solutions for making new lines for linked tables.

    -

    3.

    Or If you want to try a completely different approach,

    you can try to import the initial data ( from CSV/Excel/Google Sheet) to make a new Manual Table,

    or make a new Manual Table from scratch, and use a 'multi-line String' Column with a 'multi-line Editor' input type.

    ( * Important note, if you do that, the table loses the connection with the source Sheet/file, so any editing you make on the source will not reflect the table, but it is fully editable in our plugin)

    Then, you could place this table on a front-end page,

    where users can do front-end editing of this table as a multi-line editor,  they can hit "shift+Enter" for new lines without need of <br> tags.

    8853134963.png
    3260314598.png

    You can also limit Editing to only specific user roles on your WordPress, in table Editing tab/Editing roles.

    2258889235.png

    Here is my Video example of how that might look 

    https://watch.screencastify.com/v/9TlJL2zPdmkskEw6Y09I


    For the time being, these are all the available methods i can think of,

    but if you have any suggestion for future improvements,

    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.


    I hope that helps.

    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

  •  1,708
    Miloš replied

    Hi Debra,

    My apologies, when i re-read the ticket, i understood you actually asked how to retain the line breaks for the Export via our Export Tools as Excel.

    If you want to retain any Custom HTML you added during Export,

    you can enable this option “Include HTML” in your Table settings/Table Tools.

    9142022846.png

    This option will allow you to export columns that contain HTML (such as link, image, email, attachment, or HTML). They will be rendered as HTML in the exported files of the CSV, Excel, Print, and Copy options.

    This option is currently not available for the PDF export option.

    Please note that you should check this functionality on the front-end since if you use this option in the back-end the buttons in headers will be rendered as HTML as well.

    I hope that helps.

    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