如何用Sphinx制作斑马桌?或者如何将 jQuery 与 Sphinx 一起使用?

发布于 2024-10-08 17:13:27 字数 919 浏览 8 评论 0原文

我认为 Sphinx 生成的表格不太漂亮,因为它为表格生成了以下 HTML 代码。

<table border="1" class="docutils">
<colgroup>
<col width="43%" />
<col width="29%" />
<col width="29%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Graph</th>
<th class="head">HIR</th>
<th class="head">AIR</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>Graph</td>
<td>Circuit</td>
<td>System</td>
</tr>
</tbody>
</table>

我怎样才能变成漂亮的一张,比如斑马桌?

HTML生成的html具有jQuery,并且根据此站点,只需一行代码就有一个斑马表,但是我不知道如何使用jQuery来制作一个斑马表。

$("tr:nth-child(odd)").addClass("odd");
  • 问:如何将 jQuery 与 Sphinx 一起使用?
  • 问:还有其他方法可以让斑马桌与 Sphinx 一起使用吗?

I think the table generated from Sphinx is not pretty, as it produces the following HTML code for table.

<table border="1" class="docutils">
<colgroup>
<col width="43%" />
<col width="29%" />
<col width="29%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Graph</th>
<th class="head">HIR</th>
<th class="head">AIR</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>Graph</td>
<td>Circuit</td>
<td>System</td>
</tr>
</tbody>
</table>

How can I turn in into pretty one, for example, zebra table?

The HTML generated html has the jQuery, and according to this site, it's just one line of code to have a zebra table, but I'm not sure how to use jQuery to make a zebra table.

$("tr:nth-child(odd)").addClass("odd");
  • Q: How to use jQuery with Sphinx?
  • Q: Is there any other way to have a zebra table with Sphinx?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单调的奢华 2024-10-15 17:13:27

我在 doctools.js 添加以下代码

$(document).ready(function() {
  Documentation.init();
  $('tbody tr:even').css('background-color','#dddddd');
});

I add the doctools.js the following code

$(document).ready(function() {
  Documentation.init();
  $('tbody tr:even').css('background-color','#dddddd');
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文