Quarto
我正在创建一个网站Quarto
并希望有一个两列布局,这样我就可以很好地并排显示文本。在streamlit https://streamlit.io您可以使用columns https://docs.streamlit.io/library/api-reference/layout/st.columns获得两列布局。以下是如何布局的示例代码:
---
title: "Two columns layout Quarto"
format:
html:
code-fold: true
engine: knitr
---
I would like to have text here and here
Sentence becomes longer, it should automatically stay in their column More text
Output:
正如您所看到的,文本被组合成一个句子,而我希望将其分开,就像两列布局一样。所以我想知道这是否可能Quarto
?
流线型
这是一个例子streamlit
:
# Package
import streamlit as st
# Function with columns
def txt(a, b):
col1, col2 = st.columns([7,2])
with col1:
st.markdown(a)
with col2:
st.markdown(b)
# Example
st.write('# Example in Streamlit')
txt('I would like to have text here', 'and here')
Output:
正如您所看到的,这在两列布局中很好地显示了。
你可以使用pandoc.columns
div 创建列布局
---
title: "Two columns layout Quarto"
format:
html:
code-fold: true
engine: knitr
---
:::: {.columns}
::: {.column width="70%"}
I would like to have text here
Sentence becomes longer, it should automatically stay in their column
:::
::: {.column width="10%"}
<!-- empty column to create gap -->
:::
::: {.column width="20%"}
and here
More text
:::
::::
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)