A spreadsheet in fewer than 30 lines of JavaScript, no library used
241–250 of 274 posts
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#242Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#243Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#244Earlier quoted context omitted.
Eh, it's pretty easy to get things not on the far side of the screen; it's just hard to get it precisely in the center.
Center something vertically :). Or even better, create three divs, arranged horizontally, with a different amount of text such that all the divs are the same width and height. Note that you cannot specify a height for the parent since the text may be of arbitrary length. Makes me sad every time.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#245I am impressed. Its a neat hack, it actually is a real spreadsheet in 30 lines of code, with references fully working (ie =A3+B4 gives expected output. As does =alert("foo") but then nothing is perfect). I think it says something about the browser as a platform - these thirty lines simply assume an enormous amount that excel and visicalc could not - visicalc had to write their own screen refresh routines. It is usefu…
> What is it now that is the equivalent of writing our own screen handling routines? Centering something using CSS. :(
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#246Earlier quoted context omitted.
Center something vertically :). Or even better, create three divs, arranged horizontally, with a different amount of text such that all the divs are the same width and height. Note that you cannot specify a height for the parent since the text may be of arbitrary length. Makes me sad every time.
http://jsfiddle.net/sJXE3/
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#247Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#248Just waiting for the other 20,000 Excel features to be added. :) This may sound like an inane comment, but trying working along Excel power users for the past two decades. Most people have no idea of the crazy, huge, complicated environment that is Excel.
Unfortunately, it works for them because people like the interface - i.e. a nicely modifiable grid of values. We're in dire need of an application that simplifies working with a database, and better table-editing tools in word processors.
Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#249Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used
#250A dangerously awesome feature: eval means it probably would support anon funcs.
=document.getElementsByTagName('body')[0].parentNode.removeChild(document.getElementsByTagName('body')[0])
The line is saved in localStore, breaking the spreadsheet for future requests.