en en en en en en en en en de en en en en en gu la la la la la en en en en mk en mk en en ru en kn en kn en kn en gu kn uk ru fa en en en en en en en en en en en en en en en en en de en en cs cs da en da cs en en cs cs en en en cs cs da en da cs en en cs cs en en en fr cs da en da en en en cs en en en en en en en en en en en en en en en cs cs da en da cs en en cs cs en en en cs cs da en da cs en en cs cs en en en cs cs da en en en en en en zh en en en en en en en en en en en fr en en en en en en en
Kirk's UI Dev Blog: coding is fun: a simple random text table generator
Today I wanted to make some randomly generated tables, you can set the rows and cols and how words per entry... wrapped up here in my old boilerplate html for your copy and paste convenience...
function makeRandomTable(sel, rows, cols, wordsPerCol){
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec fringilla purus metus, sed sagittis erat elementum nec. In fringilla, mauris eu congue blandit, massa ante placerat nisl, at semper diam nibh non lorem. Aenean non nibh ligula. Vivamus luctus ligula ipsum, a euismod sapien varius at. Nam et augue nulla. Cras velit nunc, congue in iaculis vel, consectetur ut massa. Nulla condimentum sit amet nunc sed mollis. "+
"Donec venenatis sollicitudin eleifend. Pellentesque vitae adipiscing nulla, eu consequat sapien. Integer auctor metus dolor, sed venenatis lectus congue non. Curabitur vestibulum sem sed quam tincidunt, sagittis hendrerit orci ultricies. Integer at eleifend mi. Nullam magna lorem, ornare vel varius ut, faucibus at neque. Ut commodo purus ac turpis vulputate condimentum sed non metus. Donec sollicitudin tincidunt eros, non blandit turpis ultrices vel. Etiam feugiat lacus magna, nec pharetra risus congue eget. Fusce vitae augue tellus. Aliquam ut ipsum vitae augue adipiscing ultrices. Nullam id dolor ac nibh sollicitudin fringilla. Fusce vitae libero iaculis, tincidunt ligula nec, varius erat. "+
"Aliquam ornare, tellus sed facilisis tincidunt, dolor leo blandit lorem, rutrum porttitor nulla lorem ut mauris. Sed eu consectetur urna, in vehicula dolor. Vivamus neque nibh, consectetur eget porta vitae, consectetur ut lacus. Aliquam erat volutpat. Quisque in nibh porttitor odio aliquet euismod id ac est. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In eget elit tristique, semper lorem nec, porttitor nisi. Cras bibendum tincidunt vehicula. Etiam fringilla nec dolor sed sagittis. "+
"Nullam cursus, turpis sed accumsan condimentum, velit nisi blandit nulla, eget adipiscing quam sapien eget arcu. Sed quis velit leo. Curabitur quis pulvinar lectus. Vestibulum ut nisi ultricies, porta orci at, facilisis ligula. Morbi sed suscipit turpis, vitae tincidunt lorem. Nunc scelerisque nibh gravida mollis consectetur. Cras lacus mi, fermentum vel gravida quis, mollis eu ligula. Fusce porttitor sem quis molestie dignissim. Maecenas sollicitudin commodo libero ut sagittis. Morbi justo dui, commodo vel ipsum vitae, tristique rhoncus diam. Aliquam dapibus iaculis ultrices. Donec tincidunt placerat pellentesque. Vivamus et libero tempor, convallis lorem nec, cursus est. Nam a bibendum eros. Donec et rutrum velit, sit amet dapibus sapien. Vivamus consectetur, diam sit amet molestie sodales, eros elit bibendum est, sed sodales eros eros at ipsum. "+
"Mauris tincidunt faucibus nibh. Vivamus venenatis urna ac est auctor, eget dignissim orci fermentum. Donec eget nisl condimentum, ultrices est quis, sodales justo. Sed aliquam neque nulla, rhoncus lobortis sapien consequat eu. Nullam pellentesque magna turpis, vel consequat massa porttitor ac. Integer sit amet tortor eget ligula ornare sodales. Morbi sollicitudin mi vitae imperdiet volutpat. Nam vel tincidunt est, quis porttitor tellus. Sed aliquet, ante et lobortis laoreet, arcu leo ullamcorper ipsum, sit amet faucibus dui metus ut felis. "
rawText = rawText.replace(/[\.\,\!,\?,\"]/g, '');
var words = rawText.split(" ");
var buf =" ";
for(var r = 0; r < rows; r++){
buf += " ";
for(var c = 0; c < cols; c++){
buf += " ";
for(var i = 0; i < wordsPerCol; i++){
buf += words[Math.floor(Math.random()*words.length)] + " ";
buf += " ";
buf += " ";
buf += " ";
Posted by Kirk Is at 1:27 PM
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Newer Post Older Post Home
Subscribe to: Post Comments (Atom)
This blog is all about making great UIs in the browser, with a side of UX excellence. See alienbill.com for some of Kirk's portfolio.
cool virtual whiteboard service (also: planning po...
the great works of software
coding is fun: a simple random text table generato...
cheap infinite scroll in jquery
more improvements to object like encapsulation in ...
simple pixel programs for OSX
a more joyous phone ui
TRIPLE EQUALS CONSIDERED OVERRATED === = :-(
gender difference in 3d perception
a simple jquery slot machine effect
Update! This is now a proper github project with a lot of details filled in...  More Information Here ! For work they wanted a "jui...
JQuery, JSON, and Java Servlets...
So my blog has gotten a bit dry lately. It has to do with my new job: there's some flashy stuff, but less than at my old gig, and I'...
My  html5 w/ jQuery boilerplate code  grabs jQuery from the CDN, but sometimes I pull it down for local development. (I still use jQuery 1.9...
paste images right into chrome!
OK, this, despite some serious limitations, is right-sexy, "browsers can do that now?" stuff. I found a page that has a jQuery &...
animation nation part 2: introduction to raphael.js
So the other day I was talking about making an animation for my company's registration process. I quickly put together an animatio...
For some reason, the standard set of CSS cursors don't include a magnifying glass. But most browsers support .cur files, i.e. custom c...
https://javascript30.com/  - build 30 things in 30 days. Interesting!
more html5 sound toys and games goodness
Last night I gave a brief presentation about my lowLag.js audio library at the Boston HTML5 Game Dev Meetup . I was able to show off the pr...
Merry Christmas! Today is the last day for my  2016 advent calendar . I admit it ends on a bit of wimper, some of the earlier entries were...
jquery animating background positions (and colors)
Short but sweet: "background-position" tends to be a compound kind of setting, with a separate value for x and y, but the single k...
View my complete profile
Simple template. Powered by Blogger.