如何解决如何在 Asciidoc 中为表格标题、行和单元格元素添加特定的 css 属性
[.custom]
[cols="40a,80a",options="header"]
|===
|First Name
|Family Name
|John
|Smith
|==
HTML(Antora 运行后)
<table class="tableblock frame-all grid-all stretch custom">
..
..
<thead>
<tr>
<th class="tableblock halign-left valign-top"><strong>First Name</strong></th>
<th class="tableblock halign-left valign-top"><strong>Family Name</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p>John</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p>Smith</p></div></div></td>
</tr>
因此,“自定义”的“角色”已应用于
、 |
---|
元素指定特定的属性。
我该怎么做?
我已经尝试过:
对于第一个元素,并且:
对于 td 元素 但这只会在转换为 html 时给我以下内容:
我如何实现以下目标:
和
1 个答案:答案 0 :(得分:0) 您应该为内联角色使用分隔符,以确保它们解析一致。例如:
分隔符影响生成的 HTML,因此第一个实例生成 遗憾的是,该角色适用于文本内容,而不是 要实现您想要的演示,您必须使用基于表格类的 CSS 选择器。这需要向您的 Antora UI 添加自定义 CSS。也许是这样的:
相关问题
最新问题
|
解决方法
您应该为内联角色使用分隔符,以确保它们解析一致。例如:
| [.custom]*John*
| [.specific]`Woo`
分隔符影响生成的 HTML,因此第一个实例生成 <strong>
标记,第二个实例生成 <code>
块。虽然两者都有指定的类。
遗憾的是,该角色适用于文本内容,而不是 <th>
或 <td>
。目前无法为单元格本身指定角色。
要实现您想要的演示,您必须使用基于表格类的 CSS 选择器。这需要向您的 Antora UI 添加自定义 CSS。也许是这样的:
table.custom th,table.custom td {
/* appropriate styles */
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。