Archive for the ‘CSS’ Category

Missing cfdump styles on pages with certain types of DOCTYPE

Tuesday, December 11th, 2007

I’d had this problem for ages: during the development of a standards compliant site that includes a Doctype statement at the top of the XHTML code, it is not possible to comfortably use the cfdump function, a very nice tool for dumping variables that all CF developers are familiar with. All the styles are missing so instead of those nifty, colourful tables you are left with some bits of raw text on a white background that look quite ugly and are hard to work with. This issue occurs on ColdFusion and BlueDragon, probably because both engines use the same bit of CSS.

I came up with a simple solution to this problem: I just slightly modified the cfdump inline code making it a little more standards compliant and put it in an external CSS file. As a result, instead of this kind of layout:
cfdump screen grab when Doctype defined
…you get this:

cfdump screen grab when Doctype defined and the cfdump.css file included

The results are not exactly the same as the original ones, probably because of some CSS conflicts on this particular page, but I think it’s still worth trying.

The CSS file that repairs the styles can be downloaded below:

A patch for the CFML cfdump function run in an XHTML Doctype environment