In this blog post, We are going learn the Primeng Angular 11 Data table example with tutorials.
Watched slow-paced, real time development of the redesign of Ptable. Staub Heritage All-Day Pan with Domed Glass Lid, 3.5 qt. Sale $149.96 - $169.96 Sugg. $357.00 - $371.00. The poster itself looks exactly like the periodic table on the ptable homepage except that each square contains a lot of fine print containing additional information. The fine print is only legible up quite close. If you want to see what the fine print will look like just print out one of the actual size pdf's that are available at ptable.
Primeng table Tutorial
Primeng is an Angular open-source framework for a collection of Rich UI libraries. Primefaces is the author of primeng framework. Please see this post for more information. In every application, there is a need to display the large data in table form from the database in the User interface.
What is the use of table components in a web application? For example, You have to write an admin interface of eCommerce UI application like amazon, As an admin of application, you have operations like CRUD operations as well as shown the data in the admin panel of your eCommerce application. So you have to use table component to have control over products like search fields, filter, showing all fields, There are three reasons to choose a table on representing data on the browser.
First All, It helps users to display paginated data when there are many records, Secondly, It provides a good experience to display than display records at once. Users are visible and easily filter records on all records. Thus, the table feature has advantages for users.
We can use either the HTML table or Custom Data table. Primeng provides an inbuilt table that provides a lot of features (Pagination, sorting, filtering.) as described below, Hence It helps developers to write lesser code instead of writing custom code.
Features
It provides rich data table UI with a lot of features.
- Pagination
- Sorting and Filtering based on columns
- Grouping columns
- Export to PDF document
- Row, Column expand and group
- Scroll and toggle
- Context Menu
- Edit, resize and Reorder
- Responsive
This example works in Angular 2,4,6,7,8,9,10 and 11 versions include latest versions
Generate Angular Application with CLI
Please see my previous post about Primeng Angular application from Scratch I am listing out important steps for Angular CLI Installation and Generate Project.
Install angular CLI tool using npm command
![Https://ptable.com/ Https://ptable.com/](/uploads/1/3/7/1/137179003/804765554.jpg)
Create Angular project -
This creates an Angular project with all default configurations and initial components with the project structure, Install all dependencies. Run the project using ng serve Go to the project directory, and issue the command
The application starts and listens at default port 4200, Application can be accessed with http://localhost:4200.
Angular CLI Project Structure
Following is the project structure which contains all required initial components and configuration files required to run the angular project.
Integrate primeng npm in Angular
primeng is available as an npm package. First Install dependencies using
primeng npm command
Under the project directory, run the following commands This install primeng and primeicons dependencies.Https://outlook.live.com/. Install Animation module which is required dependency for primeng library
angular.json style configurations
Add primeng styles and icons in styles section of angular.json. primeng icons uses primeface icons in table.
You can check more about prime icons
App Module changes - app.module.ts Integrate BrowserAnimationsModule Many components required to have a dependency of Angular animation module
Next step is to import TableModule into application module to have access to all primeng table components and properties
Data Table Example
We will see the basic static data binding. For example, We are displaying a list of users’ data - id, name, email. Data table requires users to object in the form of an array. Component changes
In angular component, get the data and stored under User object.
Youtube.com
Template html changes
the user list is binding to the value property of a table. A list of cars is bound to the value property whereas header and body templates are used to define the content of these sections. Each primeng table contains the following templates. Each of these templates wrapped under ng-template. Caption is a title or caption content for a table Header - It is a header of the table. Provide a list of columns for a table and it is equivalent of thead tag of HTML table Body - It is a body that contains actual data and it is equivalent of tbody tag of HTML table footer - Content for a footer of the table and it is equivalent of tfoot tag of HTML table summary - Display below the table with summary content. List of objects bound to value property of p-table. There are two ways we configure table columns Static Columns In this, Every column is configured in the template of the header section
Adding dynamic columns
Here header template is configured using an array of objects. In the component, columns array is constructed with field and header keys. Following is an example of Dynamic column binding.
Both of the above codes produce the same output. Data are shown in a simple and easy way.
Sort column ascending
This is an example of sorting table based on columns. on Table level, add sortMode='multiple” and each column with adding attribute pSortableColumn and p-sortIcon tag.
When a column is clicked for sorting, Table level content is adjusted as per column sorting.
Pagination example
When there are a lot of data like 10000 rows, These data can be represented in pages. Primeng table has pagination option, You have to configure below properties paginator-true/false - Enable pagination or not. rows - Number of rows displayed on each page.
Filter Example Filter option is used to reduce the data from the table.
View all details regarding chemical elements through an interactive Periodic Table of Elements which can also take you to the corresponding Wiki page of the selected item
Even though the computer can process information a lot faster than we do and makes them easily accessible, it doesn’t mean it’s a method of cheating in school, on the contrary, it serves as a powerful documentation method. For instance, PTable provides a detailed view of the Periodic Table of Elements.
Neat layout and representation of elements
A first cool thing about it is the lack of an installer, which makes it possible to check out the set of features from the moment download is done. More than that, you can easily store it on a USB flash drive in case you always want to have it at hand. Registry entries are not modified in the process, so the target PC is not put at risk.
A pretty large window shows up on launch, with a neat representation of the Periodic Table of Elements. Colors make it easy to tell the different states and types of elements, but there are also corresponding tags to know exactly what they are. Selecting an elements enlists more details in an upper section.
Access an element’s Wiki page
As such, you get to know an element’s atomic weight, oxidation state, melting and boiling points, density, electronegativity, as well as atomic radius. On the bright side of things, the application contains a rich database of elements, including artificial compounds, being quite up to date with set of information.
You can access a history of accessed elements in a dedicated window. More than that, the copy function sends all element related details to the clipboard. In case there’s more you want to know, the application can bring up a dedicated window with the corresponding Wikipedia page. Needless to say that an active Internet connection is required for the latter function.
On an ending note
All in all, PTable is a fully-fledged, modern Periodic Table of Elements. It contains an updated list, and a great deal of information, and even provides quick access to the corresponding Wikipedia page of the selected elements to view the entire history and data.
Filed under
PTable was reviewed by Mircea Dragomir![Ptable Ptable](/uploads/1/3/7/1/137179003/778282748.png)
Ptable Chart
4.5/5
This enables Disqus, Inc. to process some of your data. Disqus privacy policyPTable 2.2.5.29526
add to watchlistsend us an updatePtable Periodic Table
- runs on:
- Windows Server 2012
Windows 2008 R2
Windows 2008 64 bit
Windows 8 32/64 bit
Windows 7 32/64 bit
Windows Vista 32/64 bit
Windows XP 32/64 bit - file size:
- 565 KB
- filename:
- PTable(Periodic Table of Elements).exe
- main category:
- Others
- developer:
- visit homepage
top alternatives FREE
top alternatives PAID