- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个表,其中 td 内的文本长度不同。我想为 td 元素提供固定宽度,并在 td 元素上使用 text-overflow: ellipsis
,这样就不会显示整个文本。我尝试了不同的方法,但没有任何效果,请有人帮助我实现这一目标。
<table>
<tr>
<th>title</th>
<th>link</th>
<th>description</th>
<th>id</th>
<th>condition</th>
<th>price</th>
<th>availability</th>
<th>image_link</th>
<th>Shipping</th>
<th>"shipping weight"</th>
<th>gtin</th>
<th>brand</th>
<th>mpn</th>
<th>google_product_category</th>
<th>product_type</th>
<th>additional_image_link</th>
<th>color</th>
<th>size</th>
<th>Gender</th>
<th>age_group</th>
<th>item_group_id</th>
<th>sale_price</th>
<th>"sale price effective date"</th>
<th>size_type</th>
<th>size_system</th>
</tr>
<tr>
<td>"Metallic turquoise leather envelope clutch"</td>
<td style="width: 200px">https://www.runway2street.com/bags/clutch-bags/metallic-turquoise-leather-envelope-clutch</td>
<td>" This elegant jeweltoned metallic leather envelope clutch with wrist strap is perfect for a fancy night out! It has a natural cork trim, magnetic closure and a zipper pocket on the inside to fit a cell phone. All accessories and hardware on the bag are gold plated. Material: 100 leather, goldplated hardwareCountry of manufacture: Lebanon "</td>
<td>4</td>
<td>new</td>
<td>"370 USD"</td>
<td>"in stock"</td>
<td>http://az697095.vo.msecnd.net/vnext/products/3/12/Anja_Not-for-the-shy_accessories_bags_clutches_Turquoise-Cork_Metallic-turquoise-leather-envelope-clutch_38_320x480_v3.jpg</td>
<td>"US::Standard Free Shipping: 47 USD"</td>
<td></td>
<td></td>
<td>Anja</td>
<td>FALSE</td>
<td>"Apparel & Accessories > Handbags, Wallets & Cases > Handbags > Clutches & Special Occasion Bags"</td>
<td>"Clutch Bags"</td>
<td>http://az697095.vo.msecnd.net/vnext/products/3/12/Anja_Not-for-the-shy_accessories_bags_clutches_Turquoise-Cork_Metallic-turquoise-leather-envelope-clutch_35_320x480_v3.jpg</td>
<td>Turquoise/Cork</td>
<td>"One size"</td>
<td>Female</td>
<td>Adult</td>
<td>ANJAFW12mec.ct</td>
<td></td>
<td></td>
<td>Regular</td>
<td>US</td>
</tr>
</table>
最佳答案
添加这个CSS规则
table td {
white-space: nowrap;
min-width: 100px;
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
border: 1px solid #000000;
}
注意:使用max-width 而不是width
关于html - 将宽度和省略号设置为表格的 <td> 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36493439/
我正在用一个 TD 和一个 colspan 属性替换多个 TD。 然而,这呈现完全不同。 我不明白为什么 不同于 我的问题是前 2 个 TD 的宽度之和与 colspanned TD 的宽度不同。
我想这是个愚蠢的问题,但我是 json 的新手,所以任何答案都会有所帮助。 我有 json 文件: `{"aaData": [ [1, "70.1700", "2008-12-29 11:23:00"
我有一个类似 html 的网页格式如下: .... . . . alo foo bla bla 现在,我只知道值 bla bla , 根据该值我们可以跟踪或找到 3rd
我有以下 html 代码: Add New Item test test test test test test test te
Name1 Position1 Operation1 Name2 Position2
如果其中的数据与同一行上第三列 td 内的数据匹配,我需要做的是向第一列 td 添加一个类。 http://jsfiddle.net/rUssu/ html 表格 firstsecondthi
有什么方法可以清除或隐藏第一个 td 的内容,从双列表中的第二个 td,而无需对实际 td 的任何编辑权限? 所以我想隐藏下表中的数字 1. Content
当第一个高度大于第二个 , 包含第二个文本 与中心对齐。我想要第二个 的文本或元素当第一个 对齐到左上角的高度大于秒。 我如何使用 css 来做到这一点? ? HTML5, CSS3 an
我这里遇到了一些麻烦。我正在开发一个按钮,一旦选择该按钮将运行 JavaScript 函数 - ShowColumn() - 这将使表格列出现。表格列首先将被隐藏 - “display:none;”
我需要将第一个 td 设为 100% 宽(包括图像)并将其他 td 放在第一个 td 下方。如何在不更改 HTML 的情况下执行此操作? 这是我的: #katalogas { float:left;
用于创建规则列表的Java类 public class CompArray { public ArrayList a1= new ArrayList(); public CompArray (){
我想在悬停在特定 td 上时更改特定 td 之前所有 td 的背景颜色。 因此,当我将鼠标悬停在该图标上时,该特定行中它之前的所有图标和文本都会更改它们的背景。 任何人都可以建议如何实现它。 这是我的
我今天花了一些时间查看使用 JQuery 遍历表及其行的示例,经过大量试验后我能够做到这一点。但是我在尝试从 td 元素获取值时遇到问题,因此我可以更改为另一个 td 元素的颜色。我有一个绑定(bin
这个问题在这里已经有了答案: Is there a "previous sibling" selector? (32 个答案) 关闭 7 年前。 我正在构建一个与此类似的表: td
当我想设置 td 的宽度时,我将 td 设置为如下宽度: ... 我已经看到通过添加一个空的 div 来设置 td 宽度: some text .h-间隔符{ 高度:0; 宽度:0; 溢
我有以下 HTML 表格: Products Pack Of Quantity Volume Unit Reb
我需要提升文本,但如果我将类应用于 IE、Opera 和 Chrome 中的 TD 或 TR,则所有单元格都会提升(背景和边框以及单元格中的文本)。请看例子: Untitled D
我试图在所有 之间放置边距除了 的 margin-top在第一行, 的底部边距在最后一行。那可能吗?谢谢。 table { border: 1px solid black; width: 98%;
我需要发布我的 td 标签的这些值,因为这是一个使用 jquery 的可编辑表。我不确定这里的问题是脚本还是 td 标签?目前我的 var_dump($_POST) 没有返回任何值。 参见下面的代码,
我想检查当前网格单元格是否是行中最后一个可见单元格。 //accurately confirms if cell is the last cell in the row, assuming there
我是一名优秀的程序员,十分优秀!