Note that there are some explanatory texts on larger screens.

plurals
  1. POSelect and copy table to clipboard
    primarykey
    data
    text
    <p>I want to select table without headers, and it works, but I cannot get it so, that it would copy to clipboard.</p> <p>Here's the page: <a href="http://tuudik.lohv.eu/Asjad/EURXML/" rel="nofollow noreferrer">http://tuudik.lohv.eu/Asjad/EURXML/</a></p> <p>Here's the code:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;title&gt;ECB kursid seisuga: 2011-04-01 &lt;/title&gt; &lt;meta http-equiv="content-type" content="text/html;charset=utf-8" /&gt; &lt;style type="text/css"&gt; table { border-collapse:collapse; } table, td, th { border:1px solid black; } &lt;/style&gt; &lt;script type="text/javascript"&gt; function selectElementContents(el) { var body = document.body, range, sel; if (body.createTextRange) { range = body.createTextRange(); range.moveToElementText(el); range.select(); range.execCommand('Copy'); } else if (document.createRange &amp;&amp; window.getSelection) { range = document.createRange(); range.selectNodeContents(el); sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); sel.execCommand('Copy'); } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table cellpadding="2"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Valuuta&lt;/th&gt; &lt;th&gt;Kurss&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody id="currencies"&gt; &lt;tr&gt;&lt;td&gt;USD&lt;/td&gt;&lt;td&gt;1,4141&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;JPY&lt;/td&gt;&lt;td&gt;118,56&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DKK&lt;/td&gt;&lt;td&gt;7,4564&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GBP&lt;/td&gt;&lt;td&gt;0,88150&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;NOK&lt;/td&gt;&lt;td&gt;7,8055&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RUB&lt;/td&gt;&lt;td&gt;40,1500&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CAD&lt;/td&gt;&lt;td&gt;1,3686&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt; &lt;input type="button" value="select table" onclick="selectElementContents( document.getElementById('currencies') );"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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