Create an eye-catching table layout and a user-friendly search tool

Is there a way to include a Search Text Box inside a table layout, similar to the image provided?

I tried adapting this example for my table Demo, but it doesn't meet my requirements. Some CSS modifications are needed to enhance...

In the example above, the search box is not actually part of the table and the CSS styling is lacking. I'm aiming for a design like the one shown in the following image:

https://i.sstatic.net/53TnB.png

Answer №1

Feel free to express yourself using your unique style. I have made some modifications to your JavaScript fiddler. Check it out here:

https://i.sstatic.net/UfJAE.jpg

Here is the updated HTML code:

<body>
<div ng-controller="ToddlerCtrl" class="toddler-search-container">
  <label>All Toddler*</label>
  <div class="search-container">
    <input type="text" name="fname" placeholder="Search City" ng-model="search.name">
    <div class="entBox">                        
                <multiwareswitchitem ng-repeat="item in toddlers |filter: search" value="item">       
                </multiwareswitchitem>                        
            </div>  
  </div>

</div>

And, here is the updated CSS Style:

body {
  font-size: 24px;
}

.toddler-search-container{
  width:100%;
  display:table;
  font-size:16px;
  font-family:calibri;
  position:relative;
}

.toddler-search-container label{
  font-weight:bold;
  float:left;
  display:block;
  margin-right:5px;
  position:relative;
}

.toddler-search-container .search-container{
  float:left;
  background:#ffffff;
  border:solid 1px #5897FB;
  display:table;
  padding:6px;
  border-radius:4px;
  box-shadow:1px 1px 5px #5897FB;
}

.toddler-search-container .search-container input{
  border:solid 1px #aaaaaa;
  margin:2px 0;
  box-shadow:inset 0 0 3px 2px #F3F3F3;
  padding:5px 5px;
}

.toddler-search-container .search-container .entBox{
  height:100px;
  overflow-y:scroll;
}

Answer №2

Why not consider utilizing the powerful combination of jquery.datatable.js and angular.data table.js? This dynamic duo offers a fantastic table template with a convenient search box that delivers instant results. Don't miss out on this opportunity to enhance your project. Unfortunately, I'm unable to provide a code snippet at the moment due to connectivity issues, but I'm more than happy to offer guidance if you decide to implement it.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When using React's setState function, it sometimes fails to re-render with the most up-to-date data and instead shows

Encountering an issue with my class component where the state is not updating with the current user value on click, but rather displaying the previous value before updating. For example, if the initial value is set to 0 and I try to update it to 20 on clic ...

What could be causing my textarea-filling function to only be successful on the initial attempt?

Programming: function updateText() { $("body").on("click", ".update_text", function(event) { $(this).closest("form").find("textarea").text("updated text"); event.preventDefault(); }); } $(document).ready(function() { updateText(); }); H ...

Convert the entirety of this function into jQuery

Can someone please help me convert this code to jQuery? I have a section of jQuery code, but I'm struggling with writing the rest! function showUser(str) { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { ...

Executing JQuery and Ajax calls within a loop

Can I dynamically change the variable in ("xxxxx").html(data) inside a for loop? I've been struggling to figure this out. My goal is to populate an HTML table with JSONP data from multiple ajax calls within a loop, where the URL changes each time. Wh ...

JavaScript scrolling allows for scrolling to a point where the element is no longer visible on the screen

I've been diving into the world of selenium and Java, attempting to utilize JavaScript for scrolling down to a specific element. However, I've encountered an issue where my script scrolls past the element, rendering it out of view. The error mess ...

Delineating the execution of a PHP function through a button click using HTML/Javascript

I have a need to trigger a specific PHP function by simply clicking on a button. Currently, I am working with the following code snippet: <table class='standardtable'> <tr> <th>Event</th> <th>Group</th> ...

Chromium CSS blend mode problem

Can anyone help me create a Photoshop overlay effect on my website? My code works perfectly in Firefox, but it's not functioning correctly in Chrome. Here's the demo. This is my current code: HTML <img src="http://lorempixel.com/output/fash ...

Are you familiar with manipulating the JSON data array retrieved from an Ajax response?

Is it possible to handle a response from AJAX request in PHP? I'm not very familiar with JavaScript, so I'm struggling with this one. This is what I have managed to put together: var base_url = 'http://dev.local/westview/public'; $(& ...

Retrieving PNG text content from a Postgres database and then transmitting the image to the React front-end

I am facing a challenge with extracting an image stored as text in my PostgreSQL server. The "buildings" table contains a column called "testimg" with a data type of "text" where the image data is stored as a PNG file's text. I have successfully conne ...

What is the best method for applying classes to a collection of DOM elements with jQuery?

I attempted two different methods of iterating through the arrays, but encountered the same error: addClass is not function First attempt using a for loop: function game(){ var cards = $('.card'); function initialize(){ for ...

Tips for ensuring consistent position and size across various window dimensions with CSS

Can someone please assist me in centering an image in the window and ensuring it stays the same size regardless of the window size? I'm unsure how to accomplish this, any tips or guidance would be greatly appreciated. ...

e.target not functioning in Opera and Chrome browsers

After implementing a jQuery navigation bar with dropdown functionality, I encountered an issue where the dropdowns did not disappear when clicking outside of the navigation bar. Despite this glitch, the majority of the functionality is working correctly. ...

The base tag does not impact the <META HTTP-EQUIV="Refresh" element in any way

Similar Question: How to check for disabled JavaScript? I am attempting to identify whether or not JavaScript is disabled in the user's browser. To achieve this, I have inserted an iframe into the document and set it to refresh every 10 seconds. ...

The values within the select list are being sent as null

A JSP file was created with an HTML form, which upon submission redirects to a servlet. The form contains a multiple select list with pre-populated values. Within the servlet, there is an attempt to retrieve these values for modification. However, upon ...

Updating new objects in Angular using JavaScript Object-Oriented Programming may not be working

Recently delving into OOP in JavaScript while working on an AngularJS website, I encountered a situation where my object methods were only altering the properties within the class, but not affecting the new object itself. //Class Var Item = function() { ...

Aligning a collapsible feature while ensuring that the content descends

My dilemma involves a centered menu with a dropdown feature. The issue arises from the absolute positioning, causing the entire menu to shift upward when the dropdown is activated due to the increased height. I am struggling to find an effective solution ...

Tips for dynamically updating an HTML value with Javascript

Summary of My Issue: This involves PHP, JS, Smarty, and HTML <form name="todaydeal" method="post"> <span id="fix_addonval"></span> <input type="radio" name="offer" id="offer_{$smarty.section.mem.index+1}" value="{$display_offe ...

Typescript and Javascript global variables

I am looking to set up a global variable with a default value const Months = [ { name: 'January' }, { name: 'February' }, { name: 'March' }, { name: 'April' }, { name: 'May' }, { name: 'June' }, { ...

Why does Typescript not enforce a specific return type for my function?

In my custom Factory function, I need to return a specific type: type Factory<T> = () => T; interface Widget { creationTime: number; } const createWidget: Factory<Widget> = () => { return { creationTime: Date.now(), foo: &a ...

Using HTML and CSS to implement a broadened perspective for a specific design

https://i.stack.imgur.com/ckQHa.png Hello, I am facing an issue with a UX design that is optimized for 1200px resolution width. However, when the HTML is loaded in a browser on a larger window resolution, there is a 200px gap on the right side. How can I ...