将html表插入具有占位符的已经存在的html文件中

问题描述 投票:0回答:1

我正在尝试使用预定义的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>&nbsp</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将分配给哪一部分?

html css
1个回答
0
投票

尝试一下,或者您可以详细说明您想问的问题。

© www.soinside.com 2019 - 2024. All rights reserved.