Print Stylesheet - Converting inputs to text

后端 未结 7 449
孤独总比滥情好
孤独总比滥情好 2021-01-02 03:59

I\'ve got a table that has some boxes in it, and I want these to show as normal text when printing. I have set up a media=\"print\"

相关标签:
7条回答
  • 2021-01-02 04:38

    Nope, I don't think this can be done without some scripting. But the scripting would be really easy to achieve with a Framework like Jquery:

    • For each input element, you would create a <span> next to it and give it a class that is hidden in the media="screen" stylesheet, and visible in media="print".

    • The input element itself would get a class that works the other way round, visible in screen and hidden in print.

    • Each input element would get a change event that updates the neighboring span.

    I don't have the JQuery routine yet to pull this out of my sleeve, and not the time to put it together right now, but it is definitely solvable and still quite unobtrusive - no need to execute any scripting when the user starts printing.

    I bet if you re-tag the question or ask a new one, one of our resident JQuery gurus will take a look at it :)

    0 讨论(0)
提交回复
热议问题