Inherit from DataTable


In order to be able to reuse some style elements from a dash_table.DataTable, I tried to inherit from DataTable but it fails brutally

here’s an exemple of code that doesn’t work:


-- coding: utf-8 --

import dash
import dash_table

app = dash.Dash(name)

class SubDatatable(dash_table.DataTable):

def __init__(self,*args,**kwargs):

app.layout = SubDatatable(
columns=[{“name”: i, “id”: i} for i in [‘First’,‘Second’]],

if name == ‘main’:

When I run this code, I get an exception (it looks like that there is an import problem at some point).

What am I doing wrong? Are there better method for ‘templating’ the DataTables than unheritance?

BTW, was unable to find how to quote code properly in my message. Is there any ‘Getting started’ for the forum?