如何用循环做出有多列是多行的table
遇到一个问题,从数据库查出数据以后要循环的把一个有多列都是多行的表格画出来
<table cellspacing="0" cellpadding="0" class="table_border" width="100%" style='text-align: center;'>
<head>
<style type="text/css">
table
{
border-collapse: collapse;
border: none;
width: 200px;
}
td
{
border: solid #000 1px;
}
</style>
</head>
<tr height='32' style='text-align: center; background: #99ccff; font-weight: bolder;'>
<td colspan="11" style="font-size: 15pt;">
测试
</td>
</tr>
<tr height='32' style='text-align: center; background: silver; font-weight: bolder;'>
<td style='text-align: center;' width='80px'>
<nobr>所属区域</nobr>
</td>
<td style='text-align: right;'>
<nobr>所属公司</nobr>
</td>
<td style='text-align: right;'>
<nobr>所属项目</nobr>
</td>
</tr>
<tr style='text-align: center; background: white; font-weight: bolder;' height='32'
height='28'>
<td rowspan='3'>
北方区
</td>
<td rowspan='2'>
大连公司
</td>
<td>
A项目
</td>
</tr>
<tr>
<td>B项目</td>
</tr>
<tr>
<td>沈阳公司</td>
<td>C项目</td>
</tr>
</table>