Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Table size can't be changed after fixed_columns and fixed_rows

$
0
0

@dqiu wrote:

Tried setting width and height in style with no luck.

import json
import pandas as pd
import dash
import dash_table
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
df = pd.read_csv('http://samplecsvs.s3.amazonaws.com/SacramentocrimeJanuary2006.csv')

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div([
    dash_table.DataTable(
        id='table',
        columns=[{"name": i, "id": i} for i in df.columns],
        data=df.to_dict('records'),
        fixed_columns={ 'headers': True, 'data': 2 },
        fixed_rows={ 'headers': True, 'data': 0 },
        style_table={
            'height': '1200px',
            'width': '2000px',
        },
    )
])

if __name__ == '__main__':
    app.run_server(debug=True)

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images