D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
thatkidralph
Full window
Github gist
Searchable Table
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> #myInput { background-image: url('/css/searchicon.png'); /* Add a search icon to input */ background-position: 10px 12px; /* Position the search icon */ background-repeat: no-repeat; /* Do not repeat the icon image */ width: 100%; /* Full-width */ font-size: 16px; /* Increase font-size */ padding: 12px 20px 12px 40px; /* Add some padding */ border: 1px solid #ddd; /* Add a grey border */ margin-bottom: 12px; /* Add some space below the input */ } #myTable { border-collapse: collapse; /* Collapse borders */ width: 100%; /* Full-width */ border: 1px solid #ddd; /* Add a grey border */ font-size: 18px; /* Increase font-size */ } #myTable th, #myTable td { text-align: left; /* Left-align text */ padding: 12px; /* Add padding */ } #myTable tr { /* Add a bottom border to all table rows */ border-bottom: 1px solid #ddd; } #myTable tr.header, #myTable tr:hover { /* Add a grey background color to the table header and on hover */ background-color: #f1f1f1; } </style> </head> <body> <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.."> <table id="myTable"> <tr class="header"> <th style="width:30%;">Campus</th> <th style="width:70%;">Program(s)</th> </tr> <tr> <td> Florida State University </td> <td> DeVoe Moore Center <BR> Gus A. Stavros Center for the Advancement of Free Enterprise and Economic Education <BR> Study of Political Economy and Free Enterprise (SPEFE), <BR> Project for Accountable Justice, <BR> Hilton Center for Economic Prosperity and Individual Opportunity </td> </tr><tr> <td> West Virginia University </td> <td> Center for Free Enterprise </td> </tr><tr> <td> George Mason University </td> <td> Mercatus Center at George Mason University, <BR> Institute for Humane Studies, <BR> Law and Economics Center </td> </tr><tr> <td> Clemson University </td> <td> Clemson Institute for the Study of Capitalism </td> </tr><tr> <td> University of Arizona </td> <td> Center for the Philosophy of Freedom </td> </tr><tr> <td> Florida Gulf Coast University </td> </tr><tr> <td> Catholic University of America </td> <td> Arthur & Carlyse Ciocca Center for Principled Entrepreneurship, <BR> Center for the Study of Statesmanship </td> </tr><tr> <td> Indiana University </td> <td> IUPUI School of Public and Environmental Affairs, <BR> Ostram Workshop in Political Theory and Policy Analysis </td> </tr><tr> <td> Troy University </td> <td> Manuel H. Johnson Center for Political Economy </td> </tr><tr> <td> Suffolk University </td> <td> Beacon Hill Institute </td> </tr><tr> <td> Utah State University </td> <td> Institute for Political Economy, <BR> Koch Scholars Program, <BR> STRATA, <BR> Center for Growth and Opportunity </td> </tr><tr> <td> University of Kansas </td> <td> Center for Applied Economics at the School of Business, <BR> Center for Entrepreneuship at the School of Business </td> </tr><tr> <td> Ball State University </td> <td> John H. Schnatter Institute for Entrepreneurship and Free Enterprise </td> </tr><tr> <td> University of Maryland - College Park </td> <td> Ed Snider Center for Enterprise and Markets </td> </tr><tr> <td> American University </td> <td> American University Political Theory Institute </td> </tr><tr> <td> University of Texas - Austin </td> <td> Center for Politics and Governance </td> </tr><tr> <td> Hillsdale College </td> </tr><tr> <td> Arizona State University </td> <td> Center for Political Thought and Leadership, <BR> Center for the Study of Economic Liberty </td> </tr><tr> <td> Duke University </td> <td> Program on Value and Ethics in the Marketplace, <BR> Markets & Management Program, <BR> Center for the History of Political Economy </td> </tr><tr> <td> Metropolitan State College of Denver </td> </tr><tr> <td> San Jose State University Department of Economics </td> </tr><tr> <td> Texas A&M Private Enterprise Research Center </td> </tr><tr> <td> Trinity College </td> </tr><tr> <td> University of NC-Chapel Hill </td> <td> UNC Philosophy, Politics, & Education Program </td> </tr><tr> <td> Texas Tech University </td> <td> Free Market Institute, <BR> Institute for the Study of Western Civilization </td> </tr><tr> <td> North Carolina State University </td> </tr><tr> <td> Western Kentucky University </td> </tr><tr> <td> Northern Michigan University </td> </tr><tr> <td> George Washington University </td> </tr><tr> <td> University of Wisconsin </td> </tr><tr> <td> University of Kentucky </td> <td> John H. Schnatter Institute for the Study of Free Enterprise </td> </tr><tr> <td> University of Louisville </td> <td> John H. Schnatter Center for Free Enterprise </td> </tr><tr> <td> Wake Forest University </td> <td> Eudaimonia Institute </td> </tr><tr> <td> Western Carolina University </td> <td> Center for the Study of Free Enterprise </td> </tr><tr> <td> University of Tennessee at Chattenooga </td> </tr><tr> <td> University of Virginia </td> </tr><tr> <td> College of Charleston </td> <td> Center for Public Choice and Market Process </td> </tr><tr> <td> Southern Methodist University </td> <td> William J. O’Neil Center for Global Markets and Freedom </td> </tr><tr> <td> Montana State University </td> <td> Center for Regulatory and Applied Economic Analysis </td> </tr><tr> <td> Mercer University </td> </tr><tr> <td> Yale University </td> </tr><tr> <td> Harvard University </td> </tr><tr> <td> Georgetown University </td> <td> Georgetown Institute for the Study of Markets and Ethics </td> </tr><tr> <td> University of Missouri </td> </tr><tr> <td> Florida Southern College </td> <td> Center for Free Enterprise </td> </tr><tr> <td> Lindenwood University </td> <td> John W. Hammond Institute for Free Enterprise </td> </tr><tr> <td> Oklahoma State University </td> <td> Institute for the Study of Free Enterprise </td> </tr><tr> <td> Emporia State University </td> <td> Koch Center for Leadership and Ethics </td> </tr><tr> <td> Hampden-Sydney College </td> <td> Center for Entrepreneurship and Political Economy, <BR> Center for the Study of Political Economy at Hampden Sydney College </td> </tr> </table> <script> function myFunction() { // Declare variables var input, filter, table, tr, td, i; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); table = document.getElementById("myTable"); tr = table.getElementsByTagName("tr"); // Loop through all table rows, and hide those who don't match the search query for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td")[0]; if (td) { if (td.innerHTML.toUpperCase().indexOf(filter) > -1) { tr[i].style.display = ""; } else { tr[i].style.display = "none"; } } } } </script> </body>
https://d3js.org/d3.v4.min.js