Jump to content

Module: Wrap Table


pmichaelis
 Share

Recommended Posts

Hey everybody,

I just uploaded a small textformatter module for wrapping tables with a div container in order to display responsive HTML tables in the frontend.

 

TextformatterWrapTable

Processwire wrap table module is a textformatter module for processwire CMS/CMF. It is wrapping markup tables with a div container.
wrapping tables with div container simplifies the process of displaying responsive tables in the frontend.

The css classes for the wrapper and the table are configurable.
.table-responsive / .table

by default the module produces the following markup:

<div class="table-responsive">
<table class="table">
...
</table>
</div>

 

Link to Repository
https://github.com/pmichaelis/TextformatterWrapTable

 

  • Like 8
  • Thanks 2
Link to comment
Share on other sites

  • 4 months later...

Hey @pmichaelis thx for the module. I've had some weird issues on my current project and tracked it down to the textformatter. Turned out that your module turned this:

<p>xxx</p>

Into that:

<html><body><p>xxx</p></body></html>

This is the fix that works for me: https://stackoverflow.com/a/22490902/6370411

I'll comment that on github if you want to fix this ? I don't think that the textformatter should add <html> and <body> to the markup, or was that intended?

  • Like 2
Link to comment
Share on other sites

  • 3 months later...

That's a very handy module. Thanks a lot.

Where I got a bit into trouble is adding multiple classes to a table, as it keeps replacing every space with an "-" and makes it therefore impossible to add multiple classes (like for instance "table table-striped" gets saved as "table-table-striped". I suppose that's the sanitizer function. Have you got any idea for a workaround?

Link to comment
Share on other sites

On 12/31/2022 at 6:20 AM, torf said:

That's a very handy module. Thanks a lot.

Where I got a bit into trouble is adding multiple classes to a table, as it keeps replacing every space with an "-" and makes it therefore impossible to add multiple classes (like for instance "table table-striped" gets saved as "table-table-striped". I suppose that's the sanitizer function. Have you got any idea for a workaround?

Hello @torf,

I pushed an update a minute ago. Please have a look, if the issue is resolved.
Happy new year.
 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...