Note that there are some explanatory texts on larger screens.

plurals
  1. POPrinting, table does not respond to portrait and landscape
    text
    copied!<p>I have a table that displays a set of data. But when I try to print the page using <kbd>Control</kbd>+<kbd>P</kbd> or <code>window.print();</code>, the table width does not respond to portrait or landscape orientation. The table width will exceed the paper width. How can I fix this?</p> <p>My table markup:</p> <pre><code> &lt;table class="datatable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th class="sorting" width="15"&gt;ID&lt;/th&gt; &lt;th class="sorting" width="15"&gt;Type&lt;/th&gt; &lt;th class="sorting" width="30"&gt;Property Type&lt;/th&gt; &lt;th class="sorting" width="50"&gt;Name/Address&lt;/th&gt; &lt;th class="sorting" width="10"&gt;Block&lt;/th&gt; &lt;th class="sorting" width="35"&gt;Unit&lt;/th&gt; &lt;th class="sorting" width="35"&gt;Sqft&lt;/th&gt; &lt;th class="sorting" width="35"&gt;$&lt;/th&gt; &lt;th class="sorting" width="35"&gt;$/Sqft&lt;/th&gt; &lt;th class="sorting" width="35"&gt;R.Yield&lt;/th&gt; &lt;th class="sorting" width="35"&gt;Status&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr id="listing1" class="odd"&gt; &lt;td class="sorting_1"&gt;1&lt;/td&gt; &lt;td&gt;Sale&lt;/td&gt; &lt;td&gt;Apartment / Condo&lt;/td&gt; &lt;td&gt; &lt;a href="/index.php/listings/view/7" title="Parc Rosewood"&gt;Parc Rosewood&lt;/a&gt; &lt;br /&gt; Default Administrator (12345678) &lt;/td&gt; &lt;td&gt;10&lt;/td&gt; &lt;td&gt;08-90&lt;/td&gt; &lt;td&gt;227&lt;/td&gt; &lt;td&gt;$2,170,000&lt;/td&gt; &lt;td&gt;$9,559&lt;/td&gt; &lt;td&gt; 1% &lt;/td&gt; &lt;td&gt; Available &lt;/td&gt; &lt;/tr&gt; &lt;tr id="listing2" class="even"&gt; &lt;td class="sorting_1"&gt;2&lt;/td&gt; &lt;td&gt;Sale&lt;/td&gt; &lt;td&gt;Apartment / Condo&lt;/td&gt; &lt;td&gt; &lt;a href="/index.php/listings/view/3" title="Woodgrove Condo"&gt;Woodgrove Condo&lt;/a&gt; &lt;br /&gt; John Doe (12345678) &lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;03-12&lt;/td&gt; &lt;td&gt;2,360&lt;/td&gt; &lt;td&gt;$1,900,000&lt;/td&gt; &lt;td&gt;$805&lt;/td&gt; &lt;td&gt; -- &lt;/td&gt; &lt;td&gt; Available &lt;/td&gt; &lt;/tr&gt; &lt;tr id="listing3" class="odd"&gt; &lt;td class="sorting_1"&gt;3&lt;/td&gt; &lt;td&gt;Sale&lt;/td&gt; &lt;td&gt;Apartment / Condo&lt;/td&gt; &lt;td&gt; &lt;a href="/index.php/listings/view/2" title="Casablanca"&gt;Casablanca&lt;/a&gt; &lt;br /&gt; John Champion (12345678) &lt;/td&gt; &lt;td&gt;7&lt;/td&gt; &lt;td&gt;01-36&lt;/td&gt; &lt;td&gt;1,326&lt;/td&gt; &lt;td&gt;$1,000,000&lt;/td&gt; &lt;td&gt;$754&lt;/td&gt; &lt;td&gt; -- &lt;/td&gt; &lt;td&gt; Available &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>CSS Markup:</p> <pre><code>table { margin: 20px 0px 10px 0px; padding: 0px; border-collapse:collapse; border-spacing: 0px; width: 100%; } thead th { text-align: left; padding: 2px 5px; border-bottom: 1px solid #E0E0E0; } </code></pre> <p>Screenshot: <img src="https://i.stack.imgur.com/uS7VR.jpg" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload