- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用以下代码,我可以在我的 jupyter notebook 或带有代码的转换后的 HTML 中显示漂亮的并排集中表格
import pandas as pd
import numpy as np
from IPython.display import display, HTML
display(HTML("""
<style>
.output {
display: flex;
flex-direction: row;
justify-content: center;
}
</style>
"""))
df = pd.DataFrame(10000*np.ones((2,2)), columns = ['foo','bar'])
display(df)
display(df)
myfile.ipynb
至
myfile.html
没有代码使用
jupyter nbconvert --to html --no-inp myfile.ipynb
表格显示时几乎没有水平空间和长滚动条,使它们相当不可用。
最佳答案
我不确定为什么表格认为在有这么多可用空间时它需要占用更少的空间,通过检查 html 我可以看到很多奇怪的 prompt
和其他空容器......无论如何......
使表格获得滚动条而不是占用全部空间的 html 样式是 overflow-x
在 .output_subarea
设置为 auto
的元素通过某些东西,它似乎与 flex 上下文中的其他自动生成的元素不能很好地配合。所以通过将它设置为 unset
我能够在没有滚动条的情况下显示完整的表格,但不能 100% 确定这会完全满足您的要求,但似乎为我解决了类似的问题。
display(HTML("""
<style>
.output {
display: flex;
flex-direction: row;
justify-content: center;
}
div.output_subarea {
overflow-x: unset
}
"""))
这很可能意味着大表只会占用所有空间而永远不会得到滚动条,可能有更好的解决方案可以通过更多的调查找到,但我不确定搜索 Jupyter 的 css 是最好的方法但我想不出别的办法。希望这适用于您的情况。 :)
关于python - jupyter nbconvert --to html --no-inp 正在缩小集中表的显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62969806/
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 已关闭 8 年前。 此问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-topic在这里
使用以下代码,我可以在我的 jupyter notebook 或带有代码的转换后的 HTML 中显示漂亮的并排集中表格 import pandas as pd import numpy as np f
如果您有 InPage Urdu 文件并且想要将其转换为 pdf 文件以供查看,那么您应该做什么? 最佳答案 可以通过多种方法来完成此任务。我发现最简单的一个如下所述: 您需要 MS Word 或其他
我试图从文本中读取 adjMatrix 图,它只读取第一行,但遇到此错误。请问有什么建议吗? java.lang.NumberFormatException: For input string: "0
我希望使用 Python 从文件中解析数据框(对于那些可能使用过的人,它的 SWMM 模型输入/inp 文件)。文件头以一种相当独特的方式打印,这使得完全解析它变得非常困难。我试图从文件中读取的带有麻
我收到上述错误。我正在验证一个字段对另一个字段,基本上是在将数据输入到文本框中之后,检查它是否存在于另一个字段中。我已经设置了一个 if 条件来确保如果数据不存在,那么它会返回到同一页面进行另一次尝试
我已经使用 numpy 实现了自定义池层,如下所示: def pooling_np(input): #input:[batch,h,v,channel] #output:[batch,h/2,v/2,
首先我想说我知道这是一个非常过时的问题。这可能就是为什么我无法通过谷歌找到任何信息的原因。 (或者我只是在搜索方面比我愿意承认的要差!哈哈。)所有结果几乎都告诉我 inp() 和 outp() 是在现
我是一名优秀的程序员,十分优秀!