Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress default class attribute #378

Closed
tom-dalton-fanduel opened this issue Sep 6, 2016 · 3 comments
Closed

Suppress default class attribute #378

tom-dalton-fanduel opened this issue Sep 6, 2016 · 3 comments

Comments

@tom-dalton-fanduel
Copy link

tom-dalton-fanduel commented Sep 6, 2016

With a table like:

class MyTable(Table):
    thing = Column()

I get a rendered output like:

<table class="table table-bordered table-hover">
    <thead>
        <tr>
            <th class="thing">Thing</th>

How do I suppress the class="thing" attribute above? I have tried 3 approaches:

  • Passing attrs={'cell':{'class':''}} to the Column constructor
  • Setting row_attrs in the Table.Meta similarly
  • Overriding Table.get_column_class_names to return an empty set.

None of the above approaches seems to have worked, but surely it must be possible?

Edit: The 'real' issue here is that one of my column names clashes with a pre-existing CSS style, and so my column takes on an unexpected style. I don't want to have to give my column a 'bad' name to work around this, nor do I want to change my existing CSS.

@jieter
Copy link
Owner

jieter commented Sep 6, 2016

#349 is a duplicate, and actually fixed by #370. I'm about to release a new version containing the code added in #370.

@jieter jieter closed this as completed Sep 6, 2016
@jieter
Copy link
Owner

jieter commented Sep 6, 2016

Released 1.2.6

@tom-dalton-fanduel
Copy link
Author

tom-dalton-fanduel commented Sep 7, 2016

That's fantastic, thanks. Can confirm the new version works for me by defining MyTable.get_column_class_names to return an empty set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants