简体   繁体   English

如何将有序列表项表与数字对齐?

[英]How to align ordered list item table to number?

I have an ordered list of tables that contain 1 row and 2 columns using the code below.我有一个使用下面的代码包含 1 行和 2 列的表的有序列表。

I am trying to get the first line of the table paragraph to align to the number similar to normal list items.我试图让表格段落的第一行与类似于普通列表项的数字对齐。 For some reason it is not aligning and the number is showing at the bottom.由于某种原因,它没有对齐,并且数字显示在底部。

How can I 1. align the table row paragraphs to the number similar to the first item and 2. align the "56 citations" paragraph to the other td in the table.我该如何 1. 将表格行段落与第一项类似的数字对齐 2. 将“56 引文”段落与表格中的另一个 td 对齐。

Thanks!谢谢!

 <ol> <li> <p>This is what a normal item</p> <p>looks</p> <p>like</p> </li> <li> <table> <tr> <td> <p>This is what a table item</p> <p>looks</p> <p>like</p> </td> <td> <p>56 Citations</p> </td> </tr> </table> </li> </ol>

Firefox 中 html 的渲染

Use vertical-align: baseline in the td element, like this:td元素中使用vertical-align: baseline ,如下所示:

 td { vertical-align: baseline; }
 <ol> <li> <p>This is what a normal item</p> <p>looks</p> <p>like</p> </li> <li> <table> <tr> <td> <p>This is what a table item</p> <p>looks</p> <p>like</p> </td> <td> <p>56 Citations</p> </td> </tr> </table> </li> </ol>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM