![](/img/trans.png)
[英]Change the color of text within a pandas dataframe html table python using styles and css
[英]html_styles_background-color change (HTML only, no CSS)
如果这实际上应该是一张表,则可以这样做:
<table width="100%"> <tr> <td> <hr /> </td> <strong style="font-size: 35px; background-color: powderblue;">Test</strong> <br /> <td> <hr /> </td> </tr> </table>
但是我很困惑为什么你有一个font-size
为35px
的<strong>
标签。 您也可以使用<h1>
:
<table width="100%"> <tr> <td> <hr /> </td> <h1 style="background-color: powderblue;">Test</h1> <br /> <td> <hr /> </td> </tr> </table>
回复您的评论, <h1>
可以被赋予这样的lightgray
背景:
<table width="100%"> <tr> <td> <hr /> </td> <div style="background-color: lightgray"> <strong style="font-size: 35px; background-color: powderblue;">Test</strong> <br /> </div> <td> <hr /> </td> </tr> </table>
但通常, <table>
中的所有子元素,包括<strong>
元素,都必须包含在<td>
元素中(表格标题除外,它们应该包含在<th>
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.