[Web4lib] incorporating a table complete with HTML tags into a web enabled database

Tim Spalding tim at librarything.com
Wed Mar 11 10:33:24 EDT 2009


Some options.

1. Don't feel too guilty about tables. This website has it best:
http://giveupandusetables.com/ :)
2. A better solution would be to store it as a blob of XML, or XHTML
3. You might also consider making an appropriate data structure (eg.,
a multidimensional array) and then serializing it, using something
like PHP's serialize() command, or by encoding it as JSON.
4. You could probably make a db structure for storing arbitrary-size
tables. That would be ideal if you were going to search, sort or group
by the data. Otherwise, I think I'd skip it.

Tim

> The best I can come up with is to put the table in an additional field complete with HTML tags and table contents. I use an HTMLEncode function on the other fields when I output them to HTML. Obviously, I would have to avoid doing this with this particular field but that would not be a problem.
>
> This approach seems to be such a terrible kludge that I can't help thinking that there must be a more elegant solution.




More information about the Web4lib mailing list