Hey everyone!

With the holiday season upon us, we want to share our upcoming working hours:

After that, we’ll return to our regular schedule and assist you as quickly as possible.

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.

Thanks a bunch for your understanding and support!

Warm regards and happy holidays!

TMS

Okay
  Public Ticket #3422238
Cell Width - wrap content
Closed

Comments

  • ampagi started the conversation

    Hello ,

    I have a table and i want every column to have different size depending on the content. 

    example:

    right now it is like this :

    |                         |                         |                         |                         |

    |                         |                         |                         |                         |

    |                         |                         |                         |                         |

    |                         |                         |                         |                         |

    and i want it to be like this :

    |             |                                                               |                         |                        |

    |             |                                                               |                         |                        |

    |             |                                                               |                         |                        |

    |             |                                                               |                         |                        |

    i already managed to do that with fixed % cell width options but im just wondering if there is a way for wpdatatables to automaticly adjust the size.

    thanks for your time.

  •  1,847
    Miloš replied

    Hi ampagi,

    this is already the default behaviour for our Table cell width.

    For example, if you disable "Limit table width" in Display settings,

    each cell is just going to expand as much as it needs to show the content of the cell.

    I tested this now by making a String One Line Column with a bit of longer text;

    and in other Columns I just have some Number, or a short text;

    This one that has longer content expands automatically, while the rest of the Columns take up the space they need.

    4641456619.png

    If you wish to experiment more with the cell width,

    you can use this selector and try different style properties on it,  to see how it behaves :

    .wpDataTablesWrapper table.wpDataTable > tbody > tr > td {
        width: fit-content !important;
    }

    I hope it helps to get the desired goal.

    Let me know how it goes. 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 | 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

  • ampagi replied

    Thanks milos,



    The case is : 

    I need the table to fit on the screen so i check the Limit Table width option.

    but i tried unchecking it aswell. and this happened

    3299073947.png

    it doesnt look like it wraps on the cell content.



    If i check the Limit Table Width option i get this

    8446588611.png

    this is propably like  

    |              25%                 |               25%                |             25%                  |                   25%            |



    Then the best solution so far for my case is when i check the Limit Table Option and i add exact % values to each column and i check the option wrap words in new line.

    and it looks like this 

    4394903130.png



    But i see this being a problem if the future if i update the tables data.


    If you have any other suggestions please let me know.


    Thanks for your time!

  •  1,847
    Miloš replied

    Hi ampagi ,

    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.

    -

    Yes, basically, if you wish to have Word Wrap option, this only appears with "Limit Table Width to Page Width" option;

    As we pointed out in this Documentation;

    When the “Limit table width” option is enabled,

     the “Word Wrap” block will be displayed. 

    Enable this option to wrap long strings into multiple lines and stretch the cells height.


    With this, you also get an additional option to set up a custom Width for each of your Columns,

    in the Display setting for each Column you can either set a fixed pixel value or a percentage value;

    how much space they will take up, as you pointed out.


    At the moment, that is the only solution we have,

    but if you have any idea what improvement or new option you would like to see,

    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 | 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

  • ampagi replied

    Goodmorning Milos,

    Thanks for the information . ill work what we got and hopefully in the future we will get more functionality.

    Thanks for your time!

  •  1,847
    Miloš replied

    Hi ampagi ,

    no problem, i am happy to advise.

    We will cover the issue from the remaining active ticket as soon as possible, as well.

    Anything else that we could assist with, please don't hesitate to create new tickets.

    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 | 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