新线路上的最后一个 td?
我为客户从word转换了一些表格数据:
<table>
<tr>
<th><p>SPAGHETTI – Deeg voorgerechten</p></th>
</tr>
<tr>
<td>SPAGHETTI AL PESCATORE</td>
<td>€11.50</td>
<td><p >Zeevruchten in speciale tomatensaus</p></td>
</tr>
<tr>
<td>SPAGHETTI ALLA MATRICIANA</td>
<td>€9.25</td>
<td><p >Met spek, knoflook in tomatensaus</p></td>
</tr>
<tr>
<td>SPAGHETTI BOSCAIOLA</td>
<td>€10.25
</td>
<td><p >Met ham, spek, knoflook in roomsaus</p></td>
</tr>
<table>
这是表格数据。它应该在表格中:)
在单词 doc 中,他将最后一个单元格(荷兰语描述)放在新行上。我可以使用 colspan="2" 将每个最后一个单元格正则表达式到新行,但这不是结构。我尝试过:
td:last-child {
display: block;
}
但每个浏览器都会忽略这一点。有什么想法吗?
编辑:听起来有点模糊,不是吗?
我有:
cell 1.1 cell 1.2 cell 1.3
cell 2.1 cell 2.2 cell 2.3
cell 3.1 cell 3.2 cell 3.3
我想要:
cell 1.1 cell 1.2
cell 1.3
cell 2.1 cell 2.2
cell 2.3
cell 3.1 cell 3.2
cell 3.3
I converted some tabular data from word for a client:
<table>
<tr>
<th><p>SPAGHETTI – Deeg voorgerechten</p></th>
</tr>
<tr>
<td>SPAGHETTI AL PESCATORE</td>
<td>€11.50</td>
<td><p >Zeevruchten in speciale tomatensaus</p></td>
</tr>
<tr>
<td>SPAGHETTI ALLA MATRICIANA</td>
<td>€9.25</td>
<td><p >Met spek, knoflook in tomatensaus</p></td>
</tr>
<tr>
<td>SPAGHETTI BOSCAIOLA</td>
<td>€10.25
</td>
<td><p >Met ham, spek, knoflook in roomsaus</p></td>
</tr>
<table>
It's tabular data. It should be in a table :)
In the word doc, he put the last cell (the Dutch description) on a new line. I could regex every last cell to a new row with colspan="2", but that's not the structure. I tried:
td:last-child {
display: block;
}
But every browser ignores that. Any ideas?
EDIT: It sounds a little bit vague, doesn't it?
I have:
cell 1.1 cell 1.2 cell 1.3
cell 2.1 cell 2.2 cell 2.3
cell 3.1 cell 3.2 cell 3.3
I want:
cell 1.1 cell 1.2
cell 1.3
cell 2.1 cell 2.2
cell 2.3
cell 3.1 cell 3.2
cell 3.3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
桌子不是这样工作的。
表示新行,
位于同一行。您永远不会(或至少不应该拥有)来自不同行的同一
的
。
编辑:
似乎您出于某种原因在不适合使用表格的情况下沉迷于使用表格。我可以建议以下实现(未经测试,您应该了解我正在尝试做的事情的基础知识)吗?
Tables don't work like that.
<tr>
signifies a new row, a<td>
is on the same row. You'll never have (or at least should never have)<td>
's from the same<tr>
on different lines.Edit:
It seems like you're hung up on using tables for some reason in a situation that is not suited for tables. May I suggest the following implementation (untested, you should get the basics of what I'm trying to do)?
试试这个小提琴:
https://jsfiddle.net/r47bm836/
似乎对我有用。
我有同样的问题。
try this fiddle:
https://jsfiddle.net/r47bm836/
seems to work for me.
I had same problem.
使用单个
将单元格 1.3、2.3 和 3.3 设为新的
。
Make cell 1.3, 2.3, and 3.3 a new
<tr>
with a single<td colspan="2">
.