magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1996 > 11 > Programming with Perl  

Browser-dependent HTML

I have always been a strong advocate of browser-independent, standard HTML as the universal medium of the Web. However, as friend and Web designer Devin Ben-Hur points out, not all browsers comply with the current standards, a situation that can stifle communications and confuse the reader. Devin suggested that I write a column about handling HTML that adapts itself to the browser dynamically. I thought that sounded like a neat idea, so here it is, and thanks to Devin (dbenhur@emarket.com) for this month's topic.

I decided to approach browser discrepancies using the table problem. Most modern browsers handle tables just fine, but twoýLynx and the W3-mode of GNU Emacsýdo not. So, to present data in a universal fashion, it must be both table-encoded for most of the world and generated as a pseudotable (using <PRE>) for browsers that can't handle tables.

One possible solution was for a filter to read an HTML-encoded table, reverse-engineer it into its rows and columns, and then perform some layout function to generate equivalent <PRE> text. This can get pretty messy, and would certainly have had me writing a hefty chunk of code. I'm too lazy for that, so I took a different approach.

Namely, I decided to generate either an HTML table or a <PRE> text area from a plain text file with tab-separated columns and newline-delimited rows. This common, unambiguous format can be parsed rapidly, and translates nicely into both <PRE> text and full-blown <TABLE> text.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2