top of page

You can create an online sortable column of data using the Java code posted here on the W3 schools site.

The code is simple to edit, just add new entries between the <td> and </td> markeers, making sure that each is separated by:

</tr> <tr>

. . . but just have:

</tr>

. . . after the last entry.

<!DOCTYPE html> <html> <head> <title>Sort a HTML Table Alphabetically</title> <style> table { border-spacing: 0; width: 100%; border: 1px solid #ddd; }

th, td { text-align: left; padding: 16px; }

tr:nth-child(even) { background-color: #f2f2f2 } </style> </head> <body>

<p>Click the button to sort the table alphabetically, by name:</p> <p><button onclick="sortTable()">Sort</button></p>

<table id="myTable"> <tr> <th>Name</th> <th>Stage</th> </tr> <tr> <td>Information Governance</td> <td>One</td> </tr> <tr> <td>Identification</td> <td>Two</td> </tr> <tr> <td>Preservation</td> <td>Three</td> </tr> <tr> <td>Collection</td> <td>Fourth</td> </tr> <tr> <td>Processing</td> <td>Fifth</td> </tr> <tr> <td>Review</td> <td>Sixth</td> </tr> <tr> <td>Analysis</td> <td>Seventh</td> </tr> <tr> <td>Production</td> <td>Eighth</td> </tr> <tr> <td>Presentation</td> <td>Ninth</td> </tr> </table>

<script> function sortTable() { var table, rows, switching, i, x, y, shouldSwitch; table = document.getElementById("myTable"); switching = true; /*Make a loop that will continue until no switching has been done:*/ while (switching) { //start by saying: no switching is done: switching = false; rows = table.getElementsByTagName("TR"); /*Loop through all table rows (except the first, which contains table headers):*/ for (i = 1; i < (rows.length - 1); i++) { //start by saying there should be no switching: shouldSwitch = false; /*Get the two elements you want to compare, one from current row and one from the next:*/ x = rows[i].getElementsByTagName("TD")[0]; y = rows[i + 1].getElementsByTagName("TD")[0]; //check if the two rows should switch place: if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) { //if so, mark as a switch and break the loop: shouldSwitch= true; break; } } if (shouldSwitch) { /*If a switch has been marked, make the switch and mark that a switch has been done:*/ rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); switching = true; } } } </script>

</body> </html>


 
 
  • Jul 11, 2017

R is a programming language that is widely used for representing statistical data graphically. See the well thought out and no frills web site for the R project at https://www.r-project.org/ . You can download the free R software for Windows here.

In order to show a spectrum of colors from a given color you can enter:

plotCol (nearRcolor ("green", "Lab", dist=50), nrow=3)

This will generate this image which shows in 3 rows shades a certain distance from the base color green. Right clicking on the image will allow you copy the image as a bitmap.

If you type in demo(graphics), you'll be walked through a series of pie, line, bar and other charts that R can generate. Here I have modified one of these scripts to create my own graphic:

> > edrm <- c(0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11)

> names(edrm) <- c("Information Governance", "Identification", "Preservation", + "Collection", "Processing", "Review", "Analysis", "Production","Presentation")

> pie(pie.sales, + col = c("orange","red","purple","purple","blue","blue","blue","seagreen3","green")) Waiting to confirm page change...

> title(main = "EDRM", cex.main = 1.8, font.main = 1)

> title(xlab = "(Electronic Discovery Reference Model)", cex.lab = 0.8, font.lab = 3)

> > par(bg="yellow")

> n <- 10

> g <- gl(n, 100, n*100)

> x <- rnorm(n*100) + sqrt(as.numeric(g))

> boxplot(split(x,g), col="lavender", notch=TRUE)

In the R console, if you right click and select 'Paste command only' and enter this script you'll get this image:


 
 

Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page