w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
CSS media print table not align margin auto
I don't know what causes the 'margin:auto;' not to work, but you can use width and margin to make sure it prints fine: table { page-break-after:always !important; display:table !important; width:80%; margin-left:10%; }

Categories : HTML

In praw, I'm trying to print the comment body, but what if I encounter an empty comment?
It usually helps to add the stacktrace so people can see the actual error. However, as the PRAW maintainer, I know the error is something like MoreComments type has no attribute body. There are three simple ways to handle your problem. The first is to simply wrap the if "Cricketbot" statement in a try/except and ignore the attribute error. try: if "Cricketbot..." ... except AttributeError: pass That's not terribly exciting though. The second method is to ensure you're actually working with an object that has a body attribute which can be done in two ways: The first is to explicitly check if the attribute exists: for comment in flat_comments: if not hasattr(comment, 'body'): continue ... The second is to verify you are actually working with Comment ob

Categories : Python

Portfolio Grid random spacing @media query
Well since you have the images hard coded in your html you might want to put a mediaQuery for mobile that makes all your images' width to 100% ....something like this: @media only screen and (max-width : 480px) { /* Smartphone view: 1 tile */ .catall img { width: 100%; } }

Categories : Jquery

Encounter error when there is if else in mvc view
@ symbol is only required when your code is contained within an HTML element. The using statement does not need the @ because it is a direct decedent of your if else block. Example: <div> <!-- html tag --> @if(something == somethingElse) // requires @ because direct decedent of html tag <div> { <p> @for (var i=0; i < len; i++) // requires @ because direct decedent of html tag <p> { if(i == 1) // doesnt require @, not decedent of any HTML tag, instead direct decedent of another razor statement (for) { //do something } } </p> } </div> The @ sign is use to distinguish between a simple string / HTML and razor statements. You only need that when you are w

Categories : Asp Net Mvc

Yocto using external toolchain encounter external_linaro_toolchain_version_handler error
I was getting a similar message Summary: There were 3 ERROR messages shown, returning a non-zero exit code. vmb@mercury:~/virtualbox-home-drive/vmb/tci6638/oe-layersetup-mcsdk/build$ bitbake Pseudo is not present but is required, building this first before the main build ERROR: Execution of event handler 'external_linaro_toolchain_version_handler' failed Traceback (most recent call last): File "external_linaro_toolchain_version_handler(e)", line 12, in external_linaro_toolchain_version_handler(e=<bb.event.ConfigParsed object at 0x1e99590>) File "external-linaro-toolchain-versions.inc", line 4, in elt_get_gdb_version(d=<bb.data_smart.DataSmart object at 0x1e0c190>) NameError: global name 'CmdError' is not defined Loading cache: 100% |#######################################

Categories : Misc

Windows Batch File - Net Use encounter "System Error 64"
See if this helps: if the network is not up it will loop indefinitely, which may not be what you want. It depends on your situation. :check if not exist "\qserveradriveRAGSQR" & timeout /t 10 & goto :check net use \qserveradriveRAGSQR /persistent:yes

Categories : Windows

[mutableArray initWithArray: [str componentsSeparatedByString:@" "]] compile is right,but encounter error while running
You forgot the call to alloc: // Assuming: NSMutableArray *mutableArray; // Then: mutableArray = [[NSMutableArray alloc] initWithArray:[str componentsSeparatedByString:@" "]]; Alternatively: mutableArray = [[str componentsSeparatedByString:@" "] mutableCopy];

Categories : Objective C

CSS @media print not working at all
First, I'd try adding a space after print. May not make a difference, but..... @media print { /*print css here*/ } Next, printing in browsers usually ignores background colors. Try using 'box-shadow'.... @media print { #bruikleenovereenkomst { width: 100%; height: 500px; box-shadow: inset 0 0 0 1000px #000; } } Smashing Magazine has some excellent pointers: http://www.smashingmagazine.com/2013/03/tips-and-tricks-for-print-style-sheets/ Note that they talk about printing from a Webkit browser (Chrome or Safari, for example), and attempting to force the printer to render the colors as they appear on-screen by using a separate media query..... @media print and (color) { * { -webkit-print-color-adjust: exact; print-color-adjus

Categories : HTML

CSS media print not working
If you're going to create a document using document.write(), you have to create the whole document. Try this: WindowObject.document.writeln('<!DOCTYPE html>'); WindowObject.document.writeln('<html><head><title></title>'); WindowObject.document.writeln('<link rel="stylesheet" type="text/css" href="css/print.css">'); WindowObject.document.writeln('</head><body>'); WindowObject.document.writeln(DocumentContainer.innerHTML); WindowObject.document.writeln('</body></html>'); Notice, that media="print" has an affect only on the print itself, page is not styled on screen. You can omit the attribute, or use media="all" instead.

Categories : Javascript

window.print() print all div content without scrollbar
This is code to print div content using javascript. <script language="javascript" type="text/javascript"> function printDiv(divID) { //Get the HTML of div var divElements = document.getElementById(divID).innerHTML; //Get the HTML of whole page var oldPage = document.body.innerHTML; //Reset the page's HTML with div's HTML only document.body.innerHTML = "<html><head><title></title></head><body>" + divElements + "</body>"; //Print Page window.print(); //Restore orignal HTML document.body.innerHTML = oldPage; } </script> <div id="printme" style="width: 100%; background-color: Blue; height: 200px"> Print me I am in

Categories : Javascript

jQuery Print function to print div content with css
You need to include the SAME stylesheet you're using in the parent page within the pop-up. You may want to make a dummy page stub/wrapper that has your stylesheet in it, then inject your HTML. var myStyle = '<link rel="stylesheet" href="http://mysite.com/mystyle.css" />'; w.document.write(myStyle + jQuery('.table_disp').html());

Categories : Jquery

JavaScript @media print stylesheet not working
css will not help in this case use javascript instead. You have to do something like this: assume this is your print button <input type="button" value="print" onclick="this.setAttribute('hidden''hidden')"/> hide the button when it clicked using the setAttribute function. hope it will work..

Categories : Javascript

Table Spacing in WordPress
Try this tr { font-size:0; /* remove space between rows */ } td { padding-right: 1px; /* add 1px right padding between imgs */ } Regarding the space between the rows - see my answer here for alternate solutions

Categories : CSS

Outlook 2007/10/13