Open yiya1989 opened 4 months ago
哈哈。发现老哥是中国人啊,就是想请教下,我再Log 里面可以设置固定高度或者自适应高度吗。。默认的有点太矮了
You can set an id-attribute on the component HTML using the elem_id
property on the Log
class:
Log("log_file.log", elem_id="gradio-log-comp-id")
And then add the CSS styling to the Gradio Blocks
class using the css
property:
import gradio as gr
with gr.Blocks(css="#gradio-log-comp-id {min-height: 200px; max-height: 800px}") as demo:
# your Gradio components
I think the Interface
class also has the css
property.
@yiya1989 这个不是代码写死的,前端直接用了 Gradio 的 Block,应该是撑满 gr.Row 的高度才对。你可以试试通过 gr.Row 的参数来调整高度:
Like the screenshot, I want to set the
height: 336px
toheight: 800px
or the xterm auto fix the height, how can I do? Thanks!