Jump to content
xisto Community

MatthewNg

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by MatthewNg

  1. Try using @media print Attach it either: <link rel="stylesheet" type="text/css" href="print.css" media="print" /> With the code below or <style>@media print{ *{ display:none; } .printThis{ /* Might want to attach this on the td and its table */ display:block; }}</style> And in the body: <body> <input type='button' onclick='window.print();'> <table class='printThis'> <tr> <td class='printThis'> My information to print </td> <td class=''> Do not print this text </td> </tr> </table></body> "@media print" would be used once the html page is being printed. Everything would be display:none so that it will not show and only attaching a class "printThis" would show that cell of the table which is what you want.
  2. CSS is much better to use. You could however have inline styles using Javascript (eg. element.style.width = "100px"). Inline styles have preference over CSS unless you use "!important" with the style. The html tags are usually for quick editing or if you don't want to add cluttered up classes, attributes to files such as <b>, <i> though it is preferable to use <span class='bold'> than <span style='font-weight:bold'> and <b>. The major advantage to use CSS instead of inline html styles is that you can change change all the element's styles that associate with that CSS rule, but inline styling is much easier to handle with Javascript.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.