Skip to content

Showing nicer tables in plugin #15525

Discussion options

You must be logged in to vote

Because the data provided isn't linked to any NetBox model, we aren't able the extend the NetboxTable class, which would normally set the required classes. However, we can set those classes manually.

class MyDataTable(tables.Table):
    name = tables.Column()
    value = tables.Column()

    class Meta:
        attrs = {
            'class': 'table table-hover',
        }

This table is still quite basic compared to NetBox tables, where sorting, filtering, etc is allowed. Those functions are all implemented in NetBoxTable.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@markkuleinio
Comment options

@markkuleinio
Comment options

@markkuleinio
Comment options

@markkuleinio
Comment options

@markkuleinio
Comment options

Answer selected by markkuleinio
Comment options

You must be logged in to vote
1 reply
@markkuleinio
Comment options

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