我有以下代码不适合整个页面。从 CPU 开始的行:usr=0.89% 是行不合适。
以 CPU 开头的行必须包含橙色背景。
此代码由 python 生成,我需要更改 python 脚本中的此问题。
在修复 python 代码之前。我需要在 html 本身中手动修复。
谁能帮帮我。
<!DOCTYPE html>
<html>
<style>
p {
font-family: Calibri;
font-size: 14px;
font-weight: bolder;
text-align: left;
}
p.fade {
color: #CCCCCC;
font-size: 14px;
}
em {
font-style: italic;
font-size: 16px;
font-weight: lighter;
}
em.pass {
font-style: italic;
font-size: 16px;
color: green;
}
em.fail {
font-style: italic;
font-size: 16px;
color: red;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
hr {
align: left;
margin-left: 0px;
width: 500px;
height: 1px;
}
table {
border-collapse: collapse;
}
.main_head {
background-color: orange;
border: none;
align: left;
margin-left: 0px;
width: 2000px;
}
tr {
padding: 4px;
text-align: center;
border-right: 2px solid #FFFFFF;
}
tr[data-type="QA"] {
color: #ff0000 !important;
}
tr:nth-child(even) {
background-color: #f2f2f2
}
th {
background-color: #cceeff;
color: black;
padding: 4px;
border-right: 2px solid #FFFFFF;
}
</style>
<body>
<table>
<table>
<tr data-type="QA">
<td style='color:BlueViolet'>Details: TEST HTML</td>
</tr>
</table>
<table>
<th class="main_head" colspan=3> CPU: usr=0.89% sys=3.38% |ssssssssssssssssssssssssssssssss
------hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh---------------------------------------------------------------------------------------
</th>
<tr>
</tr>
<tr>
<td>Name</td>
<td>First Name</td>
<td> Last Name</td>
<td> Work</td>
<td> Percentages</td>
</tr>
</table>
</table>
</body>
</html>
最佳答案
设置colspan="5"
。
你有 5 列:
<tr>
<td>Name</td>
<td>First Name</td>
<td> Last Name</td>
<td> Work</td>
<td> Percentages</td>
</tr>
所以你必须在
上设置colspan="5"
<th class="main_head" colspan="5">
关于css - HTML 不适合整个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52867744/