- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Tim Berners-Lee actually.
In this case, there is the overhead from the classes and inline style declaration where the guy should merely have used a "", this horror would actually be much using the proper structure for the case: tables.
The part you missed is that since every single length is hard-coded in pixels (height/width of the "cells") on most browsers (Opera excluded, it uses a special zoom function) the lines will start overlapping very soon instead of properly flowing, thus making the whole page unreadable.
Admin
Ooooh i broke the forum \o/
Hurray for me \o/
Admin
Just for fun, I decided to run this mess through the W3C validation tools....
Markup Validation Service(http://validator.w3.org/check?uri=http%3A%2F%2Fthedailywtf.com%2Fforums%2F74146%2Fpostattachment.aspx):
Result:
Admin
I would guess this was generated by some (monstrous) reporting tool (like Crystal and it's competitors), and then exported as HTML.
Admin
Or you could use the rows and cols attributes of the table element, a technique that will work even if CSS is disabled/not supported by the browser. Presumably Anonymous knew the size of the data set that was being returned.
Admin
Tables re-invented.
Admin
The push is to remove the use of tables for layout, not for displaying tabular data. You can do some pretty neat things for two or three column displays with divs/css, but much more than that is silly.
Admin
Of course the person who says that tables should never be used are mising the entire maxim: "Tables should never be used for layout/flow, tables are for tabulated data only."
I think that waay to many people have "heard" that you shouldn't use tables, but that's all they hear they never get the rest (like in arrested developement when the family gets letters that the stocks are unfrozen and not to sell them.. they never got past the "unfrozen").
I agree that tables shouldn't be used to hardcode layout.. css is much more elegant and you can change the appearance and layout of a site very quickly (http://www.csszengarden.com/ illustrates this well), but for data, especially data that would fit with well delineated columns, use F'ing tables, that's what they are for!!
Admin
Try this one: http://interreality.org/~reed/tmp/fidobill.htm
Admin
This is the only remotely sane explanation I could come up with. Most likely they had a system to generate printable reports in PDF (or even PostScript) format that were printed and mailed to customers. Then they decided to put this information online using a generic PDF-to-HTML converter. There's no way anyone writing a CGI to generate that kind of HTML wouldn't stop and say "Wait... isn't there an easier way to represent tabular data?" in the middle of writing an algorithm to calculate the absolute position of each cell. Although the output looked a little too clean to be auto-generated (only one tag per cell), but then there's the crazy-redundant stylesheet at the top.
That said, generating HTML like that from a page layout format like PDF is never the best way to go. Page description languages are simply presentational imformation with no semantic structure. HTML is intended to be a semantic description of content, using external presentational code in the form of stylesheets. (Perhaps it doesn't do this quite as well as it should, but this WTF is conceptually about as far from the correct way as one could get.) One of the benefits of this design is that user agents are free to apply certain tweaks to the presentation to give the user a better experience, while still keeping the semantic structure of a document apparent. When you stick everything in "semantically empty" DIV elements, you lose all of this.
Admin
http://interreality.org/~reed/tmp/fidobill.htm
Admin
Think of the screen readers, man!! Have mercy!
Admin
As someone that does no web development, I could smell the WTF coming from a while away, ...
That and it's either Bell or Rogers, and, well, both of them are full of WTF types (not the low level employees, I'm talking managment, who decide low level details, like not using tables to make tables).
Admin
{lame excuse}I think IE5 had "issues" with some things CSS2 {/lame excuse}also we were not using StyleSheets in any big way back then. Lots of asp generated html goodness - probably could find some rather embarassing and appalling things to submit if my skin were thick enough.
E.
Admin
http://interreality.org/~reed/tmp/fidobill2.htm
Perhaps this one's easier to read? :)
Admin
+1
This wtf is obviously automagically generated by some reporting tool.
Admin
Ahem...
Admin
Ah! Much better!
Admin
There are no such attributes on the table element.
Are these in the standard?
Admin
The possabilities are really endless.
fidobill3.htm
Admin
I fear that I may have actually been a consultant at the company which created this code. They provide billing software to several large telcos, as screwed up as they were, I actually believe this was the result of a tool they bought which converts AFP format to HTML. They have far bigger WTF issues than this in their systems, mostly of their own doing, but partially because telcos are merger happy and they have to constantly integrate with other billing systems which are so customized from telco to telco they are barely recognizeable as being from the same vendor.
Admin
Haha I love it. Can you write some JS to make my bills disapear?
Admin
I certainly hope not.
Admin
No THAT is the way tables should be displayed!!
Admin
I assume this cellular company still charges per byte when accessing web sites on their phones?
Admin
5 seconds to select all? I must be using a supercomputer, because it took me less than 5 seconds to select all, copy, open excel, and paste it into a worksheet.
Admin
No WTF - this was generated! :)
This reminds me The Word's Code generated for a single space, when converting doc to HTML.
<p class="MsoNormal"><i style='mso-bidi-font-style:normal'><span style='mso-ansi-language:PL'><![if !supportEmptyParas]><![endif]> <o:p></o:p></span></i></p>
Admin
What's funnier to me is that its still not valid HTML.
Tags are supposed to be lower case. The class names need to be quoted, and the NOBR tag (unlike tables) is depricated!
Admin
Daft as this sounds, it might actually work. Must find a scanner...
Admin
Yup, works fine. More fun and quicker than messing with all the html...
Admin
No, the real WTF isn't that they didn't use tables, tables is too web 1.0. The real wtf is that they used CSS, which is web 2.0. My enterprise business has evolved to web 3.0, we pad all the data using whitespaces.
Admin
<font size="5">O</font>bviously, this is the result of the poorly done table handling in ie 4.0, ca 1996. If any part of your table was wider than one screen, it would start the "table dance," a wild orgy of adjusting column widths and scroll bars. It was almost as comical as the effort put forth by the Microsoft programming team. They were both pathetic.
Admin
Wait a minute - what's wrong with hard coding every single attribute in every single cell in every possible way? You don't have to worry about those pesky HTML (and derivative) interpreters making assumptions about what you intended. No variables, javascript, etc. means no potential for sql-injection. It's a secure way of doing things!
Think about it - what if someone, let's call her Paula, wrote a brillant HTML interpreter, and decided that <td colspan="2"> really meant file-not-found? By hard-coding everything, one could protect their output from such enterpriseyness!
Admin
For the life of me, I can't find any "online viewing" option for my bill with that company. So I can only assume that SD has signed up for their online billing (which means no paper invoice is issued any more).
Which means that this HTML page replaces the monthly invoice. Which makes it pretty important that it contain the identical information to the alternative printed bill, including layout, to ensure nobody can claim that their browser ate some important detail, and to ensure that any calls to customer service about the bill don't have the additional burden of dealing with layout issues.
Personally, I think I would have chosen a signed PDF format, but that's just me.
Admin
I don't see a WTF in the divs, I've written code EXACTLY like this.
Its basically the output from a report generator and every field in the report needs a location and bosses expect things to be in the same place all the time.
If you've ever tried to convert a printed report into html tables (believe me, I tried...) you would know how difficult it can be, there are paradoxes and layout problems which just cannot be solved without absolute positioning.
I however see a WTF in the style block at the head of the original html, unique styles should be bunched together, but the generator is exporting each style within each section with its own prefixes clogging up the stylesheet and preventing minor changes.
For the layout paradoxes, consider 4 fields in a report each with data:
<font face="Courier New"> 11122222
111 333
111 333
44444333
333
How would you create a HTML table retaining that layout?
</font>
Admin
Admin
Well, web developers don't need high-end machines. Crimson Editor's my mostly used tool apart from notepad and some proprietary IDE for PHP. Guess this is what makes me an optimisation freak who seeks to shot inefficient coders (or enterprise solution providers per se).
Admin
Yes Fido has a View in PDF option. I couldn't include that in the HTML since many links are session-encoded.
Admin
LC: Ever heard of the "pre" tag?
Admin
I was about to write about that.
This page allowed me to compare Firefox and IE's performance when selecting arbitrary absolute-positioned divs. Both of are slow when compared to continuous text flow and tables (but well, I wouldn't consider that their fault), but IE is considerably slower than Firefox. It was near-instant here for Firefox, while IE6 did take a couple seconds to select all. May I guess you were using Firefox or some other non-IE browser too?
Btw, before anyone starts the IE bashing: as much as I love Firefox, its dynamic HTML rendering is way way slower than IE's, which bothers me on some websites I visit which generate huge tables from code (just like somebody suggested in the first page). It's quite the opposite of this case: IE takes no more than a second, while Firefox takes no less than ten seconds.
And to those who say the approach used in this WTF is good absolute positioning for printing, remember that in print a "pixel" has no meaning (unless I'm missing something from the CSS docs; I haven't checked). You shouldn't rely on web browsers defining pixel universally as the same dimension.
Admin
This seems to be Oracle Reports and Discoverer generated html-reports.
Atleast they generated as awful html as the aforementioned.
Admin
Some people still use Internet Explorer that have a broken CSS implementation, so nobr is still needed for these guys. This browser and Netscape 4.61 are the most anti-css stuff you can download from internet.
--Tei
Admin
It took me about 5 seconds to select all in IE. In Opera it was instant, of cause.
Admin
OF COURSE it comes from a PDF/Postscript-to-HTML generator. Geez.
It's a whole lot easier and cheaper and SAFER to feed the output of your existing bill-generating system into a Postscript-to-HTML converter than to pay a bunch of HTML kiddies to rewrite it.
Admin
The matrix - relaoded :-)
Admin
That's what the first n posters said. Use a table!
Admin
raoflmao :) nice one
Admin
But ... aren't tables deprecated. ... Just kidding.
It's funny the the captcha is broken. :-)
Admin
You misunderstand, the Fields have to stay together (which the pre tag fixes) but the layout and positioning of the fields has to also stay the same.
Like I said, somebody get me a small piece of HTML which can render those 4 fields in a table structure (consider each field to be an image) and I will change my code.
Its not a complex example (there are others) but having a working model for this would allow me to consider changing my rendering routine.
Admin
I just think that they have some CMS, and all the Bills are put there in PDF format. Then they use an pdf to html converter...