主题:  在director中如何插入表格,谢谢

nanmin

职务:普通成员
等级:1
金币:0.0
发贴:11
#12006/2/12 14:16:22
在director中如何插入表格,谢谢



Super ChiCk

职务:版主
等级:5
金币:15.0
发贴:3502
#22006/2/14 11:16:46
director可以用一些html标签来实现表格
不过做起来比较麻烦

on makeTable memberName, headings,widths,data
-- start with <HTML> and <BODY> tags
htmlText = "<HTML><BODY BGCOLOR=FFFFFF>"
-- beginning of table
put "<TABLE BORDER=1><TR>" after htmlText
repeat with i = 1 to count(headings)
put "<TD width=" & widths[i] & "><B>"&headings[i]&"</B></TD>" after htmlText
end repeat
put "</TR>" after htmlText
-- add each row
repeat with i = 1 to count(data)
put "<TR>" after htmlText
-- add a row
repeat with j = 1 to count(data[i])
put "<TD width=" & widths[j] & ">" after htmlText
put "<font color="&QUOTE&"#FFFF00"&QUOTE&">"&data[i][j]&"</font>"&"</TD>" after htmlText
end repeat
put "</TR>" after htmlText
end repeat
-- close table and html
put "</TABLE></BODY></HTML>" after htmlText
put htmlText
member(memberName).html = htmlText
end
--<font color="#FF0000">¥33.6</font>


on testTable
headings = ["Name","Address","Phone","Birthday","City","city1"]
widths = [100,150,60,60,80,110]
data = []
add data, ["John Doe", "123 Street Road", "555-3456","7/28/65", "Seattle","city1"]
add data, ["Betty Deer", "654 Avenue Blvd", "555-1234","9/11/68", "Los Angeles","city1"]
add data, ["Robert Roberts", "9346 Dead End Pl.","555-9999", "1/8/67", "New York","city1"]
makeTable("htmltable",headings,widths,data)
end



nanmin

职务:普通成员
等级:1
金币:0.0
发贴:11
#32006/2/14 16:24:50
ccloveaa在上个帖子中说
引用:
director可以用一些html标签来实现表格
不过做起来比较麻烦

on makeTable memberName, headings,widths,data
-- start with <HTML> and <BODY> tags
htmlText = "<HTML><BODY BGCOLOR=FFFFFF>"
-- beginning of table
put "<TABLE BORDER=1><TR>" after htmlText
repeat with i = 1 to count(headings)
put "<TD width=" & widths[i] & "><B>"&headings[i]&"</B></TD>" after htmlText
end repeat
put "</TR>" after htmlText
-- add each row
repeat with i = 1 to count(data)
put "<TR>" after htmlText
-- add a row
repeat with j = 1 to count(data[i])
put "<TD width=" & widths[j] & ">" after htmlText
put "<font color="&QUOTE&"#FFFF00"&QUOTE&">"&data[i][j]&"</font>"&"</TD>" after htmlText
end repeat
put "</TR>" after htmlText
end repeat
-- close table and html
put "</TABLE></BODY></HTML>" after htmlText
put htmlText
member(memberName).html = htmlText
end
--<font color="#FF0000">¥33.6</font>


on testTable
headings = ["Name","Address","Phone","Birthday","City","city1"]
widths = [100,150,60,60,80,110]
data = []
add data, ["John Doe", "123 Street Road", "555-3456","7/28/65", "Seattle","city1"]
add data, ["Betty Deer", "654 Avenue Blvd", "555-1234","9/11/68", "Los Angeles","city1"]
add data, ["Robert Roberts", "9346 Dead End Pl.","555-9999", "1/8/67", "New York","city1"]
makeTable("htmltable",headings,widths,data)
end



nanmin

职务:普通成员
等级:1
金币:0.0
发贴:11
#42006/2/14 16:26:45
ccloveaa,我是新手,看这些很晕,不过还是要谢谢你!



Super ChiCk

职务:版主
等级:5
金币:15.0
发贴:3502
#52006/2/15 8:24:24
做表格你需要懂得html的标签 TD Table br 之类都可以使用