+ -
当前位置:首页 → 问答吧 → vb如何生成 Html中 Table 行合并语句?

vb如何生成 Html中 Table 行合并语句?

时间:2011-09-08

来源:互联网



VB code
    
Print #1, "<div align='left'>"
Print #1, "<font color='Blue' size=3>" & "Module Pm Case Information: (Total " & Report_Summary_Case_Count_PM & " Case)" & "</font>"
Print #1, "<br>"
Print #1, "<table class='dataintable' border=1>"
Print #1, "<tr>"
Print #1, "<th align=Center>" & "Status" & "</th>"
Print #1, "<th align=Center>" & "Tool" & "</th>"
Print #1, "<th align=Center>" & "Module" & "</th>"
Print #1, "<th align='Center'>" & "Pm Item" & "</th>"
Print #1, "<th align='Center'>" & "Pm Result" & "</th>"
Print #1, "<th align='Center'>" & "Parts User Info" & "</th>"
Print #1, "<th align='Center'>" & "Comment" & "</th>"
Print #1, "<th align='Center'>" & "Relate Picture" & "</th>"
Print #1, "</tr>"


For i = 0 To Report_Summary_Case_Count_PM - 1
       
        Print #1, "<tr>"
            Print #1, "<td rowspan='" & Report_Summary_Case_Count_PM_Item & "'>" & Report_Summary_Case_PM_Result(i) & "</td>"
            Print #1, "<td rowspan='" & Report_Summary_Case_Count_PM_Item & "'>" & Mid(Report_Summary_Case_PM_CaseID(i), InStr(Report_Summary_Case_PM_CaseID(i), "@") + 1) & "</td>"
            
            For j = 0 To Report_Summary_Case_Count_PM_Item - 1
                Print #1, "<td>" & Report_Summary_Case_Count_PM_Item_Module(j) & "</td>"
                Print #1, "<td>" & Report_Summary_Case_Count_PM_Item_Name(j) & "</td>"
                Print #1, "<td>" & Report_Summary_Case_Count_PM_Item_Value(j) & "</td>"
            Next j
            
            Print #1, "<td rowspan='" & Report_Summary_Case_Count_PM_Item & "'>" & "No Parts" & "</td>" 'Report_Summary_Case_PM_Parts(i)
            Print #1, "<td rowspan='" & Report_Summary_Case_Count_PM_Item & "'>" & Report_Summary_Case_PM_Comment(i) & "</td>"
            Print #1, "<td rowspan='" & Report_Summary_Case_Count_PM_Item & "'>" & "NO Pic" & "</td>"   'Report_Summary_Case_PM_Pic(i)
        Print #1, "</tr>"
        
Next i
Print #1, "</table>"
Print #1, "</div>"



生成的 Html 语句:

HTML code
<div align='left'>
<font color='Blue' size=3>Module Pm Case Information: (Total 1 Case)</font>
<br>
<table class='dataintable' border=1>
<tr>
<th align=Center>Status</th>
<th align=Center>Tool</th>
<th align=Center>Module</th>
<th align='Center'>Pm Item</th>
<th align='Center'>Pm Result</th>
<th align='Center'>Parts User Info</th>
<th align='Center'>Comment</th>
<th align='Center'>Relate Picture</th>
</tr>
<tr>
<td rowspan='4'>Y</td>
<td rowspan='4'>DWPRS04</td>
<td>CP1</td>
<td>Change Tank Chemical(By 48H)</td>
<td>ok</td>
<td>CP1</td>
<td>Clear All SMIF</td>
<td>ok</td>
<td>CP3</td>
<td>Clear All Chamber</td>
<td>ok</td>
<td>CP1</td>
<td>Clear All Chamber</td>
<td>ok</td>
<td rowspan='4'>"No Parts"</td>
<td rowspan='4'>ok</td>
<td rowspan='4'>NO Pic</td>
</tr>
</table>
</div>


在网上看到这样的案例,这个是可以实现 合并的:

HTML code
<table border="1">
        <tr>
                <th>www.dreamdu.com</th>
                <th>.com域名的数量</th>
                <th>.cn域名的数量</th>
                <th>.net域名的数量</th>
                <th>总数</th>
        </tr>
        <tr>
                <td>2003年</td>
                <td>1000</td>
                <td rowspan='2'>20tb00+5000</td>
                <td>3000</td>
                <td rowspan='3'>2u0n00</td>
        </tr>
        <tr>
                <td>2004年</td>
                <td rowspan='2'>405600+7000</td>
                <td>6000</td>
        </tr>
        <tr>
                <td>2005年</td>
                <td>8000</td>
                <td>9000</td>
        </tr>
</table>


不知道哪里出现了细节问题?

作者: QQ342151559   发布时间: 2011-09-08

真没明白...什么合并?
你是要输出tab字符?

作者: spt_petrolor   发布时间: 2011-09-09

热门下载

更多