我正在尝试使用下面的代码(粘贴链接)生成 HTML 代码,预期的输出如下所示,我得到一个输出,其中 CR 值被添加了两次,而且 http 链接也不正确......谁能帮助审查逻辑看看我哪里出错了
我的代码:-
http://pastie.org/5391102
输入如下
http://pastie.org/5390316(if you copy/paste ,make sure they are tab seperated,otherwise you will get a key error)
预期输出:-
<table cellspacing="1" cellpadding="1" border="1">
<tr>
<th bgcolor="#67B0F9" scope="col">CR</th>
<th bgcolor="#67B0F9" scope="col">FA</th>
<th bgcolor="#67B0F9" scope="col">CL</th>
<th bgcolor="#67B0F9" scope="col">Title</th>
</tr>
<tr>
<td><a href="http://prism/CR/409452">409452</a></td>
<td>WLAN</td>
<td>656885</td>
<td>Age out RSSI values from buffer </td>
</tr>
<tr>
<td><a href=http://data/409452>409452</a>,<a href=http://data/12345>12345</a></td>
<td></td>
<td></td>
<td>To Record HAL and SLM FW Event Logging</td>
</tr>
</table>
我当前的输出:
<table cellspacing="1" cellpadding="1" border="1">
<tr>
<th bgcolor="#67B0F9" scope="col">CR</th>
<th bgcolor="#67B0F9" scope="col">FA</th>
<th bgcolor="#67B0F9" scope="col">CL</th>
<th bgcolor="#67B0F9" scope="col">Title</th>
</tr>
<tr>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href=http://prism/CR/Title>Title</a></td>
<td>wlan</td>
<td>656885</td>
<td>Age out rssi values from buffer</td>
</tr>
<tr>
<td><a href="http://prism/CR/409452, 12345">409452, 12345</a></td>
<td><a href="http://prism/CR/409452, 12345">409452, 12345</a></td>
<td><a href=http://prism/CR/Title>Title</a></td>
<td></td>
<td></td>
<td>To Record HAL and SLM FW Event Logging</td>
</tr>
</table>