[Web4lib] outputting a pre formatted list from a database to a webpage

Araby Y Greene araby at unr.edu
Tue Aug 22 15:26:16 EDT 2006

Since you have tabular data, using a table to display it makes sense. You could store the html in your query's fields rather than in the table's data columns. For example, if you need to write an html table row for each row of data, create fields in the query to output the html. Enter a name for the field expression followed by a colon in the query designer when you don't use a real field in the db:

begrow:"<tr><td>"  realcol  td:"</td><td>"  realcol   endrow:"</td></tr>"

You can use the same technique to add redundant link information, etc. to Access queries. The downside is sending more info across the network. Generally, it's better to script the html into the web page, but if you don't have a choice, this method should work.


Araby Greene
Web Development Librarian
Getchell Library/322
University of Nevada, Reno

araby at unr.edu
775.784.6500 x343


> -----Original Message-----
> From: web4lib-bounces at webjunction.org [mailto:web4lib-
> bounces at webjunction.org] On Behalf Of John Fitzgibbon
> Sent: Tuesday, August 22, 2006 9:03 AM
> To: web4lib at webjunction.org
> Subject: [Web4lib] outputting a pre formatted list from a database to a
> webpage
> Hi,
> I have a list which forms part of a description. The description is in a
> field in an Access database. This field is outputted to a number of web
> pages; the database serves as a back end to a number of web pages.
> In one of the fields, I now need to add a list consisting of two
> columns. I will have to store the HTML tags with the list in the Access
> field. However, I don't want to use the div, or table element because
> frequently, the field is output to a web page where it is enclosed by
> span tags. Block elements are not allowed within inline elements such as
> span.
> My plan is to store it in Access along with the <pre> tag and, thus,
> output it using the <pre> tag having each column separated by a tab. The
> problem with this is that the data in column one is sometimes quite long
> forcing the data in column two further right like so.
> <pre>
> Inns or Hotels	1.
> Public Houses	31.
> Mail Coach Offices	2.
> Dispensary	1.
> Trades - townland Callings -
> Surgeons	2.
> Apothecaries	2.
> Wine and Spirit Merchants	3.
> Grocers and Wine Merchants	3.
> Spirit Merchants, Grocers and Ironmongers	4.
> Tobacco Manufacturers	1.
> </pre>
> I wish to line up the data in column two. Is there any character other
> than a tab that I can use?
> Is using the pre element within an inline element allowed?
> Any ideas would be welcome.
> Regards
> John
> John Fitzgibbon
> p: 00 353 91 562471
> f: 00 353 91 565039
> w: http://www.galwaylibrary.ie
> *******************************************************************
> Tá eolas atá príobháideach agus rúnda sa ríomhphost seo
> agus aon iatán a ghabhann leis agus is leis an duine/na daoine
> sin amháin a bhfuil siad seolta chucu a bhaineann siad.
> Mura seolaí thú, níl tú údaraithe an ríomhphost nó aon iatán
> a ghabhann leis a léamh, a chóipáil ná a úsáid.
> Má tá an ríomhphost seo faighte agat trí dhearmad,
> cuir an seoltóir ar an eolas thrí aischur ríomhphoist
> agus scrios ansin é le do thoil.
> This e-mail and any attachment contains information which is
> private and confidential and is intended for the addressee
> only. If you are not an addressee, you are not authorised
> to read, copy or use the e-mail or any attachment.
> If you have received this e-mail in error, please notify
> the sender by return e-mail and then destroy it.
> *********************************************************************
> _______________________________________________
> Web4lib mailing list
> Web4lib at webjunction.org
> http://lists.webjunction.org/web4lib/

More information about the Web4lib mailing list