在句子中内联 HTML 表格单元格

问题描述

有没有办法使用 CSS 将 HTML 表格单元格内联在普通文本流中,使文本出现在周围文本的基线处?

简单地使所有表格元素内联会使文本向下移动,如下例所示,这是不可取的。

table,table > tbody,table > tbody > tr,table > tbody > tr > td {
    display: inline;
}

table > tbody > tr > td {
     padding: 0px;
     margin: 0px;
}
<div style="width: 40em;">
  A table containing
  <table>
    <tbody>
      <tr>
        <td>possibly multiple cells</td>
      </tr>
      <tr>
        <td>containing potentially a high amount of text that should not be shifted down</td>
      </tr>
    <tbody>
  </table>
  below the baseline.
</div>

解决方法

要实现您的目标,您应该将 func tableView(_ tableView: UITableView,cellForRowAt indexPath: IndexPath) -> UITableViewCell { // Dequeueing custom cell let cell = self.tableView.dequeueReusableCell(withIdentifier: "CustomCell",for: indexPath as IndexPath) as! CustomCell // Flag to display separators if indexPath.row == 0 { cell.showTopSeparator() else if indexPath.row == data.count - 1 { cell.showBottomSeparator() } return cell } 添加到每个有问题的表格元素中。

此外,您不需要针对具有祖先层次结构的每个元素。这应该足够了:

import { types } from "pg";

types.setTypeParser(16,(value) => { // 16 is the type enum vaue of boolean
    return Boolean(parseInt(value));
});
vertical-align: baseline;

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...