![](/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.