擅长:python、mysql、java
<p>我建议在<code>to_html</code>函数中使用格式化程序,参数说明:</p>
<blockquote>
<p><strong>formatters</strong> : list or dict of one-parameter functions, optional formatter functions to apply to columns’ elements by position or name,
default None. The result of each function must be a unicode string.
List must be of length equal to the number of columns.</p>
</blockquote>
<p>如果要将所有的<code>Name</code>列设为粗体,则示例:</p>
<pre><code>df.to_html(formatters={'Name': lambda x: '<b>' + x + '</b>'})
</code></pre>
<p>让我知道它是否有效!</p>