【发布时间】:2021-03-29 18:53:40
【问题描述】:
我已经使用 Julia 在 Dash 中构建了一个表格:
df = DataFrame(Day=["Monday","Tuesday","Wednesday"],
Object=["Egg","Cat","Phone"],
Letters=["A","B","C"],
Food=["Milk","Egg","Cheese"])
app = dash()
app.layout = html_div() do
dash_datatable(id="data_table",
columns = tuple([(name=x,id=x) for x in names(df)])[1],
data = df_to_datatable(df),
style_cell = (textAlign="center", fontSize=16,
backgroundColor="rgb(50,50,50)",
color="white"),
style_header = (backgroundColor="rgb(30, 30, 30)",),
style_table = (textAlign="center", minwidth="35%",
width="35%",maxwidth="35%",
marginLeft="auto",marginRight="auto"),
#style_cell_conditional = (if(filter_query="Egg"), backgroundColor="#3D9970"),
),
html_div(id="output_div")
end
生成此表:
我正在尝试有条件地格式化包含“Egg”的单元格,但我遇到了问题。我尝试关注other examples 和 DashTable 的documentation,将 Python 语法转换为 Julia。我还尝试解决我的尝试产生的错误(例如“LoadError:语法:意外','”)但没有成功。非常感谢任何帮助!
编辑:我也一直在咨询conditional formatting documentation,但语法是 Python,我仍然无法转换为 Julia。
【问题讨论】:
-
感谢您提供的链接,@as11 -- 我一直将此页面用作参考,但我仍然无法将 Python 语法转换为 Julia。这很有帮助,但不会立即回答我的问题。
-
@BasvanderLinden -- 实际上,代码会生成显示的表格。没有语法错误。
标签: datatable formatting julia plotly-dash