Skip to content

Instantly share code, notes, and snippets.

View Jaskaranbir's full-sized avatar
😁
Coding fun stuff....

Jaskaranbir Dhillon Jaskaranbir

😁
Coding fun stuff....
View GitHub Profile
@Jaskaranbir
Jaskaranbir / html_table_generator.js
Created May 17, 2016 00:26
To generate tabular grid in html using javascript
var body = window.document.getElementsByTagName('body')[0];
// Square Grid
(function genGrid(size) {
var table = document.createElement('table');
table.setAttribute('border', '2');
table.setAttribute('cellspacing', '0');
table.setAttribute('cellpadding', '40');
// This variable isn't required.
// Just exists to make this script code friendly so the grid size can be changed
@Jaskaranbir
Jaskaranbir / Java-String-to-Tabular-Format.java
Created May 1, 2016 18:38
A manual way to convert a given set of parallel strings in Tabular Format
public static String[] generateTable(ArrayList<String> lines){
// A list to store every single element individually
ArrayList<String> sl = new ArrayList<>();
int length = lines.get(0).split(" ").length; // Number of individual
// elements
// Create an array of every element individually
for (String line : lines) {
String[] sp = line.split(" ");
for (String semiChars : sp)
@Jaskaranbir
Jaskaranbir / simple_dynamic_web_editor.html
Created May 1, 2016 17:31
A simple web editor that displays results dynamically as you type
<html>
<head>
<title>Dynamic Web Editor</title>
</head>
<body>
<style>
body{
margin:0;
}
textarea{