{"id":202304,"date":"2013-11-15T17:29:02","date_gmt":"2013-11-15T13:29:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=202304"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=202304","title":{"rendered":"<span class=\"post_title\">\u041a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0439 Excel \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript (30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430)<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ul>\n<li>\u041e\u043a\u043e\u043b\u043e 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e JavaScript<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <strong>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442<\/strong><\/li>\n<li>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u0430\u043a \u0432 Excel (\u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 &quot;=&quot;)<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (=A1+B2*C3)<\/li>\n<li>\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0445\u043d\u0430\u043d\u0438\u0435\u043d\u0438\u0435 \u0432 localStorage<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/caa\/b47\/a6c\/caab47a6c9b36e45823ef342411f714d.png\" alt=\"image\"\/><br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  HTML:  <\/p>\n<pre><code class=\"html\">&lt;table&gt;&lt;\/table&gt; <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CSS:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"css\">input {     border: none;     width: 80px;     font-size: 14px;     padding: 2px; }  input:hover {     background-color: #eee; }  input:focus {     background-color: #ccf; }  input:not(:focus) {     text-align: right; }  table {     border-collapse: collapse;   }  td {     border: 1px solid #999;     padding: 0; }  tr:first-child td, td:first-child {     background-color: #ccc;     padding: 1px 3px;     font-weight: bold;     text-align: center; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  JavaScript \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"javascript\">for (var i=0; i&lt;6; i++) {     var row = document.querySelector(&quot;table&quot;).insertRow(-1);     for (var j=0; j&lt;6; j++) {         var letter = String.fromCharCode(&quot;A&quot;.charCodeAt(0)+j-1);         row.insertCell(-1).innerHTML = i&&j ? &quot;&lt;input id='&quot;+ letter+i +&quot;'\/&gt;&quot; : i||letter;     } }  var DATA={}, INPUTS=[].slice.call(document.querySelectorAll(&quot;input&quot;)); INPUTS.forEach(function(elm) {     elm.onfocus = function(e) {         e.target.value = localStorage[e.target.id] || &quot;&quot;;     };     elm.onblur = function(e) {         localStorage[e.target.id] = e.target.value;         computeAll();     };     var getter = function() {         var value = localStorage[elm.id] || &quot;&quot;;         if (value.charAt(0) == &quot;=&quot;) {             with (DATA) return eval(value.substring(1));         } else { return isNaN(parseFloat(value)) ? value : parseFloat(value); }     };     Object.defineProperty(DATA, elm.id, {get:getter});     Object.defineProperty(DATA, elm.id.toLowerCase(), {get:getter}); }); (window.computeAll = function() {     INPUTS.forEach(function(elm) { try { elm.value = DATA[elm.id]; } catch(e) {} }); })(); <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u043d\u0430 JSFiddle \u2014 <a href=\"http:\/\/jsfiddle.net\/zag2art\/b3pbw\/4\/\">http:\/\/jsfiddle.net\/zag2art\/b3pbw\/4\/<\/a>   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/202304\/\"> http:\/\/habrahabr.ru\/post\/202304\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ul>\n<li>\u041e\u043a\u043e\u043b\u043e 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e JavaScript<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: <strong>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442<\/strong><\/li>\n<li>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u0430\u043a \u0432 Excel (\u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 &quot;=&quot;)<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (=A1+B2*C3)<\/li>\n<li>\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0445\u043d\u0430\u043d\u0438\u0435\u043d\u0438\u0435 \u0432 localStorage<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/caa\/b47\/a6c\/caab47a6c9b36e45823ef342411f714d.png\" alt=\"image\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-202304","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202304"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202304\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}