擅长:python、mysql、java
<p>在经过一些研究和<a href="https://stackoverflow.com/users/6805091/bubble-bubble-bubble-gut">Bubble Bubble Bubble Gut</a>的帮助后,可以通过以下方式轻松地用<code><tr align="center"></code>替换所有<code><tr></code>标记:</p>
<pre><code>html2 = html.replace('<tr>', '<tr align="center">')
print(html2)
</code></pre>