2個表格拼成一個!
<table width="20%" cellspacing="0" cellpadding="0" border="0" align="left" rules="all" class="tbldata">
!ig[BO C0 <tr class="headtxtGroupOrg">Ruby Community{9ld3^
tM7PlF0E
<td width="20%" height="29" align="left">
&p{CK\r6Y0 <span class="font1"> 組名</span>
,?"_K@9dy$x%G X0 </td>
YM#U3Ta)f a'P0 </tr>Ruby CommunityTWGgpC)\z ^
<% for info in @mail_group %>
nU C(F(G'O"L0 <tr>Ruby Community&w3DKNR`2S
<td width="20%" height="25px" id="<%=info.sort_no%>" name="<%=info.sort_no%>" class="td" style="cursor:pointer" nClick="funcBgcolor(this.id,'<%=@mail_group.length%>','<%=info.id.to_s%>','<%=info.updated_no.to_s%>','<%=@bgcolor%>')" bgColor="<%=@bgcolorif info.id.to_s == params[:hidGroupID].to_s %>">Ruby Community'shy#p*f-W8`$^~j8G
<%=DSP.Label("gname","8",info.mail_group_name,"0") %>Ruby CommunityLW)n'~@ BNH$d9P
</td>Ruby Community*Ga$@[.l'aTp
</tr>Ruby Communityh)m6[8F9Ni,D!}8j t
<% end %>Ruby Community"cS J.UF!h
<% if @mgpLen < @madsslen %>Ruby CommunityW_9]9u}Ql~_S
<% for i in1..@madsslen- @mgpLen %>Ruby Community9U/c?@b(URFG`
<tr>Ruby Community:x)wU O%vR&O
E
<td width="20%" height="25px"></td>Ruby CommunityJf |Li*Q;GC
</tr>
8mtO3ZPg nFn&z0 <% end %>
{Z&j,Z7Bo4E0 <% end %>Ruby Community7ycG#OQ
</table>Ruby Community
Z4C p4l$Mi~c
<table id="t1" width="80%" border="0" cellspacing="0" cellpadding="0" align="left" class="tbldata">
N9LSa e)c6bmaK0 <tr class="headtxtGroupOrg">Ruby CommunityYC#ll i'F8i
<td width="38%" height="29" align="left">Ruby Community6n5@i$Hn8i4q-Y(g_
<span class="font1">姓名</span>Ruby Community2C;}%GH+h-OG0k9c/]
</td>
|_}&l}uASS)K0 <td width="20%" align="left" class="font1">Ruby Community2u2X\0Q5rJ,B v
敬称
$V9g!}.J9_!PU0 </td>Ruby Communityfiz[g{t
<td width="25%" align="left" class="font1">Ruby Communityb/HC{x@"Bi.?5O
名字讀音
bI:m_K$gjW0 </td>Ruby Community"A)axdONL9f
<td align="left" class="font1">
[Y7d5LW$IuUx0 内外Ruby Communitya ok5Z9JzM.c
</td>
)\6^t1B#Yv r^x0 </tr>
2L*`#Jj{)zIB"n!u:Rs)`0 <% if @mail_addresses != nil and @mail_addresses.length > 0 then %>
)IV3`2Llc*Nz0 <% for info in @mail_addresses %>
g2g}En1u2JK/u0 <% info.kana_name = "" if info.kana_name == nil %>Ruby Community];_lAWR Y
jz
<% info.keyi_name = "0" if info.keyi_name == nil %>Ruby CommunityeR,W^
RV
<% info.office_mail_address = "" if info.office_mail_address == nil %>Ruby Communityh3k!zg1t5e;`0S
<% info.mail_address = "" if info.mail_address == nil %>Ruby Community'Lr2b e;Q.~l
<input id="add_update_no_<%=info.id.to_s%>" name="add_update_no_<%=info.id.to_s%>" type="hidden" value="<%=info.updated_no.to_s%>">
|"n]&E"i]6k0 <tr class="trBgcolor">
NA7`2R*r;P4|0 <td height="25px" class="td" id=link2>Ruby Community:enhze`%^
<a href="/sk1406/linkto?method=index" nclick="funcLink('<%=info.id%>');return false;"><%=DSP.LabelBusyo("gname","13",info.name,"0",params['address' + info.id.to_s]) %></a>
sR] {0\f#S(c0 </td>
$Fq*EwdM/~c0 <td height="25px" class="td">Ruby Community/kU1Hxqd$z-\\Z
<%= '閣下' if info.keyi_name == '1' %><%= '閣下' if info.keyi_name == '2' %>Ruby CommunityRV&C
m
WOWSL%P
</td>
;@)d'G;b5L;U-}.Z0 <td height="25px" class="td">Ruby Community2qo8IL*e,\Vw
<%=DSP.Label("kananame","8",info.kana_name,"0") %>
r\2E P;f&^1M5aBoB)^$h`0 </td>
;\NdX9k0D4T7\0 <td class="td" height="25px">Ruby Community*G qkl.wt5n
<% if info.office_mail_address.length > 0 and info.mail_address.length > 0 %>Ruby Community0j8w"Bq
X
<img src="/images/lab_inside.gif" width="18" height="15"><img src="/images/lab_outside.gif" width="17" height="15"><% elsif info.office_mail_address.length > 0 %>Ruby Communityad)f8zA
<img src="/images/lab_inside.gif" width="18" height="15"><% elsif info.mail_address.length > 0 %>Ruby Communityw8i-Lo o;f|P
<img src="/images/lab_outside.gif" width="17" height="15">Ruby Community:jB YJ;a7aNl
<% else %>
'x?)ac-}5p:l0 Ruby Community(Gd/[2K7iEYG
<% end %>
9]M"}+\8xU0 </td>
8st:xsV0 </tr><% end %>Ruby Community9oH/jW|z(s#uc4l
<% end %>Ruby Community M4]"Gb1K)L*F@{;S e
<% if @mgpLen > @madsslen %>
2\6@ Ms`,S0 <% for i in1..@mgpLen- @madsslen %>
b*o*T4s2B:R0 <tr class="trBgcolor">Ruby Community/]nH(}#C!v `@+V
<td width="20%" height="25px" class="td" id=link2></br></td>
mj rG$`Z5^0 <td width="20%" height="25px" class="td"></br></td>Ruby Community_ JWl? \1q
<td class="td" height="25px" class="td"></br></td>Ruby CommunityT*h(L _V2J$I
<td class="td" height="25px" class="td"></br></td>Ruby Community3r N'e$mq h4K1l
</tr>
]1w-`/xG0w1o {0 <% end %>
(S0nVk3WO/Y$el0 <% end %>Ruby Communityjog#sZ.S&}
T3M~
</table>
中間的是數據部分,大家根據不通的需要修改!
==================================
組名 姓名 名字讀音 敬稱 內外
組1 (選中) 張三1 zhangsan 內部
組2 張三2 zhangsan 閣下 內部
組3 張三3 zhangsan 閣下 內部
組4 張三4 zhangsan 外部
組1 被選中 有4個人
如果組2被選中
組名 姓名 名字讀音 敬稱 內外
組1 李四1 lisi 內部
組2 (選中) 李四2 lisi 閣下 內部
組3 李四3 lisi 閣下 內部
組4 李四4 lisi 外部
js:(funcBgcolor)
function funcBgcolor(tdid,len,clickid,udpno,bgcolor){Ruby Community4^1S.o-y2{xM C
document.myform.hidGroupID.value = clickid;Ruby CommunityLU
V
JJJ
document.myform.updated.value = udpno;Ruby Community2D`8r-O!cA/Wf
for (var i = 1; i <= len; i++) {
&l j[BBZ0 document.getElementById(i).bgColor = '#FFFFFF'; #白色
F*I#^0H8Zo0 }Ruby Community7jjtfF
document.getElementById(tdid).bgColor = bgcolor; #bgcolor:一種顏色Ruby Community&iESt']-e}N
submitForm("/sk1405/linkto?method=groupclick"); # submitForm form.action=“" ;form.submit()
8]-E%\6q.?%^R0}
function funcLink(addressid){Ruby Community;aF'Dmjgu;m/W
document.myform.hidAddressID.value = addressid; #一個表的IDRuby CommunityX+b(p O;HVZJ
submitForm("/sk1405/linkto?method=showAddressInfo"); # 同上Ruby Community)v:sb7N'fc
}
controller中的寫法 更具不通人的需求就不用, 主要是貼 2個表成一個表的效果
关键点 <table align ="left > 2個表格都是這樣寫 就OK 了
miG8Y"c9nI ^-c-PH4n0
TAG:

