0

I'm using jQuery Footable V3 and trying to using the class="" attribute to but when the table is initialized the class attr desappear

Here is my example

<table class="table footable " data-page-size="20"  data-paging="true" data-filtering="true" data-sorting="true" ">
                <thead>
                    <tr>
                        <th data-type="number" data-breakpoints="all" >ID</th>
                        <th data-sortable="false" data-filterable="false" data-formatter="formatter">X</th>
                        <th data-type="text" data-sortable="true"><?=_("Descripción")?></th>
                    </tr>
                </thead>
                <tbody>
    <tr class="danger">
                        <td>1111111111111</td>
                        <td>1111111111111</td>
                        <td>1111111111111</td> </tbody> </table>
Martin Varta
  • 766
  • 1
  • 7
  • 10

1 Answers1

1

Not only class attributes are removed from static tables (where HTML was already created before footable() call) but also HTML inside TD (links, images etc.) with current version 3.0.1. The current FT 3 documentation is misleading concerning "static" tables, partially wrong.

Have a look at Github issues. You'll find some related to your question.

The best way to avoid this behavior is to load table rows and columns via JSON strings e.g. created with PHP.

Or to use workarounds. Use attributes like data-myclass="danger" and convert it via JQuery to class attribute after FT has been initialized. Sometimes slow!

Or use FT 2 until developers post a statement or maybe new version 3.

bertmert
  • 26
  • 2