|
Post by tnorvell on May 21, 2008 19:43:45 GMT -5
Anyway to place two tables side by side?
Anyway to place an image in a table cell?
Anyway to attach a link to a single element in a table (not an entire column handler)?
|
|
|
Post by StefanPendl on May 22, 2008 8:18:31 GMT -5
Anyway to place two tables side by side? See the following example of placing two tables inside another table to align them side-by-side. dim items$(3,2)
for column = 0 to 3 for row = 0 to 2 items$(column, row) = "Item "; column; ","; row next next
table #ta, items$() table #tb, items$()
cssclass ".myBorder", "{Border-Style: Solid; Border-Width: 1px; Padding: 3px}"
#ta allclass("myBorder") #tb allclass("myBorder")
html "<table align = center; width = 100%><tr><td align = center>" render #ta html "</td><td align = center>" render #tb html "</td></tr>"
The native TABLE command does not support this, but you can create such a table using the HTML command. See the answer to your second question.
|
|
|
Post by StefanPendl on May 22, 2008 19:06:14 GMT -5
Anyway to place an image in a table cell? The following example displays the images found in the public folder in a table. files #dir, ResourcesRoot$; "\*.jpg" notEmpty = #dir hasanswer() print notEmpty
if notEmpty then maxCount = #dir rowcount() print maxCount
html "<table border=solid cellpadding=3 cellspacing=5>" for i = 1 to maxCount dummy$ = #dir nextfile$() fileName$ = #dir name$() imgName$ = "../../"; fileName$ html "<tr><td>" html "<img src="""; imgName$; _ """ alt="""; fileName$; _ """ title="""; fileName$; _ """ width=160>" html "</td><td>" print imgName$ html "</td></tr>" next html "</table>" end if
|
|
|
Post by tnorvell on May 24, 2008 14:09:46 GMT -5
Splendid - that works wonderfully!
|
|
|
Post by StefanPendl on May 25, 2008 4:16:21 GMT -5
Altered the code to display images in a table, since it seems to be more reliable to use imgName$ = "../../"; fileName$ instead of imgName$ = "../public/"; fileName$, which refused to work directly after posting the code.
|
|