我想使用PHP数组创建看起来更简单的表,并且需要使用Javascript的帮助。 最初我想像第一个表一样创建表,但是由于PHP数组的提供者的限制,我遇到了问题。
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
</style>
<table>
<thead>
<tr>
<td rowspan="3">Scope/Coverage</td>
<td colspan="5">Economically Active</td>
<td rowspan="3">Percentage of Working to Economically Active</td>
<td colspan="4">Not Economically Active</td>
<td rowspan="3">Total</td>
<td rowspan="3">Percentage of Economically Active to Working Age Population</td>
</tr>
<tr>
<td rowspan="2">Working</td>
<td colspan="3">Unemployment</td>
<td rowspan="2">Total of Economically Active</td>
<td rowspan="2">Attending School</td>
<td rowspan="2">Housekeeping</td>
<td rowspan="2">Total of Not Economically Active</td>
</tr>
<tr>
<td>Ever Worked</td>
<td>Never Worked</td>
<td>Total</td>
</tr>
</thead>
</table>
由于开发人员的限制,我得到了一个特定的PHP数组,并按如下方式打印:
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
</style>
<table>
<thead>
<tr>
<td rowspan="3">Scope/Coverage</td>
<td>Economically Active</td><td>Economically Active</td><td>Economically Active</td><td>Economically Active</td><td>Economically Active</td><td></td><td>Not Economically Active</td><td>Not Economically Active</td><td>Not Economically Active</td><td>Not Economically Active</td><td></td><td></td></tr><tr><td></td><td>Unemployment</td><td>Unemployment</td><td>Unemployment</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Working</td><td>Ever Worked</td><td>Never Worked</td><td>Total</td><td>Total of Economically Active</td><td>Percentage of Working to Economically Active</td><td>Attending School</td><td>Housekeeping</td><td>Others</td><td>Total of Not Economically Active</td><td>Total</td><td>Percentage of Economically Active to Working Age Population</td></tr><tr> </tr>
</thead>
</table>
如果您能帮助我解决这个问题,那就太好了