我正在尝试使用预定义的html和css插入表,如下所示:
<style>table, th, td {
padding: 2px;
border: 1px solid black;
border-collapse: collapse;
width: 630px;
table-layout: fixed;
}
</style>
<table style="margin: 3pxborder: 5px solid black" >
<tr style="background-color: #aeaeae" >
<th> </th>
<th colspan=1 style="color: white" >header1</th>
<th colspan=1 style="color: white" >header2</th>
</tr>
<tr style="background-color: white;table-layout: fixed" >
<td style="padding: 1rem" >Value1</td>
<td style="padding: 1rem" >11</td>
<td style="padding: 1rem" >12</td>
</tr>
<tr style="background-color: white;table-layout: fixed" >
<td style="padding: 1rem" >Value2</td>
<td style="padding: 1rem" >21</td>
<td style="padding: 1rem" >22</td>
</tr>
</table>
放入一个已经存在的html文件中,该文件带有占位符,表值将移至这些文件。我尝试将css部分插入到定义css的部分中,但是似乎无法像上述表格粘贴到单个文件中那样被识别。带有占位符的文件分为共享css和内联css,属于该表的css将分配给哪一部分?
尝试一下,或者您可以详细说明您想问的问题。