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

标签 jquery python python-sphinx

我认为从 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>

我怎样才能变成漂亮的 table ,例如斑马 table ?

HTML生成的html有jQuery,并且根据this site , 只需一行代码就可以得到斑马表,但我不确定如何使用 jQuery 来制作斑马表。

$("tr:nth-child(odd)").addClass("odd");
  • 问:如何将 jQuery 与 Sphinx 结合使用?
  • 问:有没有其他方法可以用 Sphinx 做一个斑马表?

最佳答案

我在doctools.js中添加了以下代码

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

关于jquery - 如何用 Sphinx 制作斑马 table ?或者如何将 jQuery 与 Sphinx 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4504533/

相关文章:

java - 我需要我的 <a> 链接标记在下拉菜单中显示为可点击链接,而不仅仅是显示文本值

jquery - 在同位素(砖石)网格中使用带有背景图像的 Slick Carousel - 幻灯片高度变为 1px

python - 如何比较同时包含字符串和整数的列? python Pandas

javascript - 无法在没有 url 参数的情况下将样式表与 window.open 链接

python - Pandas :自相关图在哪里?

python - 如何使用 zbar 获取图像上检测到的二维码的 x、y 位置?

python - Sphinx 不显示泛型类的类实例化参数(即参数类型)

documentation-generation - 狮身人面像 : List of supported languages for highlighting?

python - ReadTheDocs 从 __init__.py 导入错误

jQuery:append() 对象,用delay() 删除它