Most of the pages shown on the WWW contain tables. Since this is a very practical and well known format, we support it with COAST. We differ two kind of tables. Fixed size tables when you know the layout in advance and dynamically sized tables. The second case is the more interesting and we will concentrate on this one in the next steps.
[[#wd DisplayAnythingRenderer { /AnythingInfo { "<table border=0>" "<tr>" " <th>Account-No</th><th>Name</th><th>Currency</th>" "</tr>" "<tr valign=top>" " <td>123456</td><td align=right>Tax</td><td>CHF</td>" "</tr>" "<tr valign=top>" " <td>546123</td><td align=right>Savings</td><td>CHF</td>" "</tr>" "<tr valign=top>" " <td>987456</td><td align=right>Loan</td><td>USD</td>" "</tr>" "</table>" } }]]
[[#wd DisplayAnythingRenderer { /AnythingInfo { "/DataContents {" " "<table border=1 cellpadding=3 cellspacing=0>" # HTML definitions for table with" " "<tr bgcolor=#BEBEBE><th>" # specific options" " "Konto</th><th>" # Headers of the table" " "Kontobezeichnung</th><th>"" " "Währung</th></tr>"" " {" " /List { " " /ListName AccountData # data source" " /EntryStore ActualData # temporary stored at" " /EntryHeaders {" " "<tr bgcolor=#FFFAFA>"" " "<tr bgcolor=#D3D3D3>"" " }" " /EntryRenderer { # renderer for the columns" " "<td>"" " {/Lookup ActualData.KTOST}" " "</td><td>"" " {/Lookup ActualData.KTOBEZ}" " "</td><td>"" " {/Lookup ActualData.WHRC}" " "</td></tr>"" " }" " }" " }" " "</table>"" "}" } }]]Be aware, that this is a complex specification and allows for a lot of customization through self made renderers in the body of the cell specifications.
[[#wd DisplayAnythingRenderer { /AnythingInfo { "void Ex4Page::Preprocess(Context &c)" "{" " Anything tmpStore= c.GetTmpStore();" " " " // get some data probably from a Host Transaction" " // Transaction::ExecTransaction(c, "AccountAccess ", input, output);" " " " // get for recipe 20 some data from a file in Anything-format" " Anything input;" " iostream *is = System::OpenStream( "AccountData.any ", 0 );" " if ( is != 0 ) {" " // opened ok; now read the content, close the file and store the data in tmpStore" " input.Import(*is);" " delete is; is = 0;" " " " tmpStore[ "AccountData "] = input;" " }" "}" } }]]
See renderer specifications
See page preprocess
This renderer is supposed to be changed and adapted to your needs!!
See more renderers and especially the list renderer.