Print CSS styles

Print CSS styles

JemandJemand Posts: 1Questions: 0Answers: 0
edited January 2011 in TableTools
Hey,

I am wondering how to print the table with the exact same styles (with different colors between odd and even rows) it is displayed in the print-preview (where all the other stuff is removed from the webpage). I found this line in TableTools.js:

[code]$(document.body).addClass( 'DTTT_Print' );[/code]

I tried to use the classes 'DTTT_selectable' in different ways, but it did not work. Has someony an idea?

My other question is whether there is a ZeroClipboardPdf.as with the same styles like above (difference between even and odd rows).

Here a screenshot that you now which style I mean: http://img192.imageshack.us/img192/4637/unbenanntneh.png

Best regards,
Jemand

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Jemand,

    It sounds like the browser is trying to be clever and removing the background colours in order to save ink. There is a media type for CSS with which you can target printing, but it might require a little setting up - and I'd be willing to bet that each browser is different in how it handles it. Printing from the web is still a bit of a nightmare! This is a ALA article about it might which be of interest: http://www.alistapart.com/articles/goingtoprint/

    As for the PDF - what you would need to do is to modify the ActionScript file and recompile it with the row colours you want. At the moment TableTools doesn't allow much control of the table styling in the PDF document - so while it's possible to do it, it just requires a bit more work :-)

    Allan
  • jc3835jc3835 Posts: 10Questions: 0Answers: 0
    Dredging up old threads again...

    Allan, you mention modifying the ActionScript file and recompiling...
    My implementation of DataTables is very dependent on conditional row coloring.
    Is there any way to send existing CSS classes to the ActionScript, rather than editing the ActionScript?
    Unfortunately, we have no way to edit, let alone compile, ActionScript files. We're limited in that we can't install programs on our own.

    Thanks, as always.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > Is there any way to send existing CSS classes to the ActionScript

    You could, but what would the CSS mean to the ActionScript given that it isn't an HTML rendering engine? You would need some code in there to transform the classes into something meaningful to ActionScript so it can output what you are looking for.

    > Unfortunately, we have no way to edit, let alone compile, ActionScript files

    Any text editor will allow you to modify the AS3 files that are shipped with TableTools and the mxml compiler is free and open source from Adobe: http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK

    Allan
  • jc3835jc3835 Posts: 10Questions: 0Answers: 0
    Thanks for the reply.
    I expected as much about sending CSS to the ActionScript files.

    Free and open source doesn't mean that IT will install it for us though... that was my meaning about our limitations.
This discussion has been closed.