- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我运行了一个生成 HTML 页面的脚本,但我无法正确设置生成的表格的格式。需要制作一张尽可能宽的表格。目前,我必须指定一个特定的宽度 (1500px),这样每个单元格的内容就不会换行到下一行。这是一个例子:
With width set to 1500px:
+-----------------------------+------------------------------+
|Contents of my cell | Contents of other cell |
+-----------------------------+------------------------------+
With width set to 100%:
+-------------------+--------------------+
|Contents of my |Contents of other |
|cell |cell |
+-------------------+--------------------+
理想情况下,我的文本不会换行(例如,当宽度设置为 1500 像素时),但不必设置静态表格宽度。有时,表格可能需要比 1500 更宽(或更小),因此我希望宽度尽可能动态。
这是我目前使用的 CSS:
<style type="text/css">
h1 {
text-shadow: rgba(255, 255, 255, 0.796875) 0px 1px 0px;
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
font-weight: normal;
padding: 7px 7px 8px;
text-align: left;
line-height: 1.3em;
font-size: 24px;
}
table {
border: 1px solid #DFDFDF;
background-color: #F9F9F9;-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
font-family: Arial,"Bitstream Vera Sans",Helvetica,Verdana,sans-serif;
color: #333;
width: 1500px;
}
th {
text-shadow: rgba(255, 255, 255, 0.796875) 0px 1px 0px;
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
font-weight: normal;
padding: 7px 7px 8px;
text-align: left;
line-height: 1.3em;
font-size: 14px;
color: #555;
}
td {
font-size: 12px;
padding: 4px 7px 2px;
vertical-align: bottom;
border-right: 1px solid #DFDFDF;
}
</style>
关于如何做到这一点有什么想法吗?
最佳答案
如果你想让它永远不会换行,试试 white-space:nowrap 并降低表格的宽度。
td {
font-size: 12px;
padding: 4px 7px 2px;
vertical-align: bottom;
border-right: 1px solid #DFDFDF;
white-space:nowrap;
}
关于html - 使 HTML 表格足够宽以适应内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13406447/
我遇到了问题,似乎无法解决。 基本上,我希望我的菜单和文本随着分辨率的变化/放大/缩小而调整大小;图片工作正常,内容 div 工作正常,只是菜单似乎无法适应。 请帮我解决这个问题.. 普通 View
我在map reduce上开发了大约20个工作,包括pagerank算法。我从未发现任何具有挑战性的问题可以在线适应mapreduce框架。我想提高自己的技能。有这样的指南吗? 最佳答案 您正在寻找的
我了解到 Java 中没有 NOR,我可以使用 !A && !B 或 !(A||B)。既然 A 和 B 都是假的,为什么我不能使用 !A || B? 最佳答案 因为Java没有NOR运算符,你的表达式
我需要根据构建 CLI 工具的要求评估“GO”,该工具应该可以在不同的操作系统中运行。这是如何在诸如“Cloud Foundry CLI”之类的 CLI 工具中实现的?GO 如何处理这种对操作系统的适
所以我试图让我的下拉菜单正常工作。下拉列表位于我的标题中的列表项下,该列表项会根据用户的用户名而变化。这使得大小不同,但我无法让下拉菜单跟随宽度调整大小。 示例 1: http://jsfiddle.
我已经很努力了,但我还是被 matplotlib 卡住了。请忽略,mpl 文档让我有点困惑。我的问题涉及以下方面: 我用 matshow 函数画了一个对称的 n*n 矩阵 D。行得通。 我想做同样的事
我正在尝试调整 Boyer-Moore c(++) Wikipedia implementation获取字符串中模式的所有匹配项。实际上,维基百科实现返回第一个匹配项。主要代码如下: char* bo
我在底部嵌套了带有文本的 flex 元素。顶部元素具有小于文本的固定宽度: .list-header { display: flex; width: 150px; height: 80px
我想初始化 std::any带有仅 move 类型变量。我找到了 Cannot move std::any . 编译错误案例 在使用链接答案中的 shared_ptr 解决方法之前,我测试了以下代码:
现在我正在使用 webview 处理 ListView 。在这个 listview webview 中用于显示图像。它来自 url。现在我面临一个问题,我无法从 url 获得唯一尺寸的图像,一些图像很
我的文件夹结构是这样的: src --main.cpp tests --src ----main_test.cpp Makefile 我想制作一个像make main_test这样的目标,以便能够以.
前段时间我也在讨论类似的话题。我正在查看我的应用程序,我认为它有很多不必要的代码。我的意思是我有服务负责从两家书店的不同类别的书籍中抓取数据。现在我有 5 个类别,所以我有 5 个方法,但如果我要添加
我使用多个 div 子元素创建父元素,然后根据 data-value 属性在 JavaScript 中计算这些子元素的宽度。 如果我对所有 child 的计算宽度求和,我最终将得到 100%。但出于某
我像这样使用减速板 gem : require 'airbrake' Airbrake.configure do |config| config.api_key = 'XXXXX' confi
我们在企业环境中有一个 svn 存储库结构,如下所示: root libs shared_lib1 shared_lib2 private_lib public_cod
我制作了一个应用程序,其中有许多从 UIView 子类化的 View 。这些 View 的大小和方向是随机的,并且可以保存应用程序屏幕的状态。当用户在打开屏幕的同一设备上保存屏幕时,屏幕状态为“正常”
我需要调整 lucene 的 StandardTokenizer 以适应有关 twitter 数据的一些特殊目的。目前,我使用 StandardTokenizer 来标记一些我想要处理的推文。它工作得
在Windows Store应用中,如果内容是固定的,我们可以把它封装成一个ViewBox,让内容适应不同的分辨率。但是,如果内容不固定,在我的应用程序中,有一个 GridView 哪些项目是动态的,
一切都在标题中。 在我的应用程序中,根据用户所做的选择,我用一个列表填充一个组合框,该列表有时很小(1 个元素)有时很大(150 个元素)。 我想要的不是在启动时将固定高度设置为给定值,而是将 max
我的 2 div 动画感谢我下面的 jquery 脚本。当屏幕小于 700px 时,div 变成更小的正方形(35px 而不是 50px)。我希望 .animate({width:100px}); 仅
我是一名优秀的程序员,十分优秀!