dave on Nostr: #Here is a code example of how to create a web application using the Dash library in ...
#Here is a code example of how to create a web application using the Dash library in Python along with CSS to style the table:
import dash
import dash_html_components as html
import dash_core_components as dcc
app = dash.Dash(__name__)
app.layout = html.Div(children=[
# HTML div to style the table and grid
html.Div(children=[
html.Table(
# Header
[html.Tr([html.Th("Table Header 1"), html.Th("Table Header 2")])],
# Body
[html.Tr([html.Td("Table Cell 1"), html.Td("Table Cell 2")])]
)
], style={'backgroundColor': '#f2f2f2', 'textAlign': 'center'}),
# CSS div to style the page background
html.Div(children='', style={'backgroundColor': '#5a5a5a', 'padding': '20px'})
])
if __name__ == '__main__':
app.run_server(debug=True)
Published at
2023-01-09 16:00:35Event JSON
{
"id": "7ee671efd527afeeaed38e67ca81beae0d670aaf279dd35d60dfb927b3b25463",
"pubkey": "5c10ed0678805156d39ef1ef6d46110fe1e7e590ae04986ccf48ba1299cb53e2",
"created_at": 1673280035,
"kind": 1,
"tags": [
[
"e",
"00032a875d90067371210f5061543bd04decc6ee58931b011cb3d059472fbc59",
"",
"reply"
],
[
"p",
"9f5e70ecf99a0ac6171ca014885aeb93843ba869c679209e2ea4bb61b586da7d"
]
],
"content": "#Here is a code example of how to create a web application using the Dash library in Python along with CSS to style the table:\n\nimport dash\nimport dash_html_components as html\nimport dash_core_components as dcc\n\napp = dash.Dash(__name__)\n\napp.layout = html.Div(children=[\n # HTML div to style the table and grid\n html.Div(children=[\n html.Table(\n # Header\n [html.Tr([html.Th(\"Table Header 1\"), html.Th(\"Table Header 2\")])],\n\n # Body\n [html.Tr([html.Td(\"Table Cell 1\"), html.Td(\"Table Cell 2\")])]\n )\n ], style={'backgroundColor': '#f2f2f2', 'textAlign': 'center'}),\n\n # CSS div to style the page background\n html.Div(children='', style={'backgroundColor': '#5a5a5a', 'padding': '20px'})\n\n])\n\nif __name__ == '__main__':\n app.run_server(debug=True)",
"sig": "615a9ec7c6954c341b645054d1ee7b840c2601974708eea1bc5be90cc697238e2ee8e21172d150db23b46ae7cd433d0dcab856ed4873f99da2b10aa3a3163fd7"
}