Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Plotly破折号:溢出到省略号中只有一个datatable列_Python_Plotly Dash - Fatal编程技术网

Python Plotly破折号:溢出到省略号中只有一个datatable列

Python Plotly破折号:溢出到省略号中只有一个datatable列,python,plotly-dash,Python,Plotly Dash,将文本溢出为短划线数据表的省略号的示例似乎适用于所有需要它的列。 是否可以指定我要将此应用于哪些列 app.layout = dash_table.DataTable( data=df.to_dict('records'), columns=[{'id': c, 'name': c} for c in df.columns], style_cell={ 'overflow': 'hidden', 'textOverflow': 'ellip

将文本溢出为短划线数据表的省略号的示例似乎适用于所有需要它的列。 是否可以指定我要将此应用于哪些列

app.layout = dash_table.DataTable(
    data=df.to_dict('records'),
    columns=[{'id': c, 'name': c} for c in df.columns],
    style_cell={
        'overflow': 'hidden',
        'textOverflow': 'ellipsis',
        'maxWidth': 0
    }
)
假设我想让“第1列”溢出到省略号中,而不是其他的


谢谢

您可以使用
style\u data\u conditional
属性将给定样式仅应用于某些列,请参见。在您的情况下,代码应该是这样的:

style_data_conditional=[{'if': {'column_id': 'column 1'}, 'textOverflow': 'ellipsis'}]