如何遍历一个list,根据list的自定义属性找到放置在table中的位置

怎么遍历一个list,根据list的自定义属性找到放置在table中的位置
我做的一个课程表
学生属性:
private String stuId;
private String stuPass;
private String stuName;
private String stuGender;
private String academy;
private String stuClass;
private ArrayList<Course> courses;

课程属性:
private String courseId;
private float coursePoint;
private String courseName;
private String academy;
private String index;
private String courseTea;
private String courseRoom;

页面显示:
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<th width="10%"></th>
<th>星期一</th>
<th>星期二</th>
<th>星期三</th>
<th>星期四</th>
<th>星期五</th>
</tr>
<tr height="80">
<th>一二节</th>
<td id="1"></td>
<td id="2"></td>
<td id="3"></td>
<td id="4"></td>
<td id="5"></td>
</tr>
<tr height="80">
<th>三四节</th>
<td id="6"></td>
<td id="7"></td>
<td id="8"></td>
<td id="9"></td>
<td id="10"></td>
</tr>
<tr height="80">
<th>五六节</th>
<td id="11"></td>
<td id="12"></td>
<td id="13"></td>
<td id="14"></td>
<td id="15"></td>
</tr>
<tr height="80">
<th>七八节</th>
<td id="16"></td>
<td id="17"></td>
<td id="18"></td>
<td id="19"></td>
<td id="20"></td>
</tr>
<tr height="80">
<th>九十节</th>
<td id="21"></td>
<td id="22"></td>
<td id="23"></td>
<td id="24"></td>
<td id="25"></td>
</tr>
<tr height="80">
<th>十一十二节</th>
<td id="26"></td>
<td id="27"></td>
<td id="28"></td>
<td id="29"></td>
<td id="30"></td>
</tr>
</table>
我想通过课程的index属性(1-30),然后和td的id相匹配,找到匹配到后把课程的信息在相应的地方显示出来。求大神们给个思路
------解决方案--------------------
你如果连一楼的代码都看不懂······那真的不是我们三两句能给你解释的清的了····随手给你贴一段很早的一个页面的布局,你看下你能看懂多少吧  从一页中间截的 肯定有找不到的变量 大概看下是那么个意思 你借鉴一下
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background="<%=basePath %>images/tab_12.gif">&nbsp;</td>
        <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6" onmouseover="changeto()"  onmouseout="changeback()">
          <tr>
          <!-- 
            <td width="3%" height="22" background="<%=basePath %>images/bg.gif" bgcolor="#FFFFFF"><div align="center">
              <input type="checkbox" name="checkall" onclick="checkAll();" />
            </div></td> -->
            <td width="3%" height="22" background="<%=basePath %>images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">序号</span></div></td>
            <td width="10%" height="22" background="<%=basePath %>images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">条形码</span></div></td>
            <td width="10%" height="22" background="<%=basePath %>images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">设备名称</span></div></td>
            <td width="15%" height="22" background="<%=basePath %>images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">设备类别</span></div></td>
            <td width="10%" height="22" background="<%=basePath %>images/bg.gif" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">品牌</span></div></td>