How to display output data in tabular form in Node.js ? Last Updated : 01 Jul, 2020 Comments Improve Suggest changes Like Article Like Report Tables are a combination of rows and columns. Node.js has its own module named as a table that helps in making tables with a wide variety of styles that can be applied to the table such as border styles, colors body style, etc. Installation of module: npm install table Syntax: table(data, config) Parameters: data: Data is an Array of array i.e. data to be saved in the table. config: Different predefined configuration. Return Value: A string is returned by the function. Example 1: Filename: script.js javascript let table = require("table"); let data, config; // Data to be saved in the tables data = [ ["A", "B", "C"], ["D", "E", "F"], ["G", "H", "I"], ] config = { // Predefined styles of table border: table.getBorderCharacters("ramac"), } let x = table.table(data, config); console.log(x) Step to run this program: Run script.js using the following command: node script.js Output: Example 2: Filename: script.js javascript let table = require("table"); let data, config; data = [ ["A", "B", "C"], ["D", "E", "F"], ["G", "H", "I"], ] // Creating column width configuration config = { columns: { 0: { width: 1 // Column 0 of width 1 }, 1: { width: 20 // Column 1 of width 20 }, 2: { width: 5 // Column 2 of width 5 } } }; let x = table.table(data, config); console.log(x) Step to run this program: Run script.js using the following command: node script.js Output: Comment More infoAdvertise with us Next Article How to display output data in tabular form in Node.js ? T tarun007 Follow Improve Article Tags : JavaScript Web Technologies Node.js Node.js-Misc Similar Reads How to display static JSON data in table in Angular ? In this article, we will see How to display static JSON data in the table in Angular. We will be displaying static data objects in Angular Table. We need to iterate over the object keys and values using key values and then handle them in the table. We will be using the bootstrap table and Angular Pr 3 min read How to Create a Pre-Filled forms in Node.js ? Pre-Filled forms are those forms that are already filled with desired data. These are helpful when a user wants to update something like his profile, etc. We just create a folder and add a file, for example, index.js. To run this file you need to run the following command. node index.js Filename: Sa 2 min read How to return an array of lines from a file in node.js ? In this article, we will return an array of lines from a specified file using node.js. The fs module is used to deal with the file system in node.js and to read file data we use fs.readFileSync( ) or fs.readFile( ) methods. Here we will use the readFileSync method to read the file, and we use the st 2 min read How to display the JSON data in EJS Template Engine ? EJS (Embedded JavaScript) is a templating language that allows dynamic content generation in NodeJS applications. It allows the integration of JavaScript code within HTML, making it easier to display dynamic data. To render JSON data in an EJS template, we can use EJS syntax to loop through the data 2 min read How to import data from .CSV file into MySQL table using Node.js ? What is .CSV file? The .CSV (Comma Separated Values) files are plain text files that contains a list of data separated by comma(,). It is a format best used for tabular data, row, and columns, exactly like a spreadsheet, just the difference is that the file is in the form of plain text. The idea of 4 min read How to load data from JSON into a Bootstrap Table? This article describes how a Bootstrap Table is created using a given JSONÂ data. The data can be retrieved by either importing it or representing it in JavaScript. The following are given two methods to do it. Displaying JSON data without importing any file: The JSON file that has to be read can be 4 min read How to fetch data from JSON file and display in HTML table using jQuery ? The task is to fetch data from the given JSON file and convert data into an HTML table. Approach: We have a JSON file containing data in the form of an array of objects. In our code, we are using jQuery to complete our task. The jQuery code uses getJSON() method to fetch the data from the file's loc 3 min read How to Create a Simple Server in Node.js that Display Hello World ? We will create a simple server in Node.js that returns Hello World using an express server. Node.js is a powerful JavaScript runtime built on Chrome's V8 engine, commonly used to build scalable network applications. One of the fundamental tasks when learning Node.js is creating a simple server that 2 min read How to Add Data in JSON File using Node.js ? JSON stands for Javascript Object Notation. It is one of the easiest ways to exchange information between applications and is generally used by websites/APIs to communicate. For getting started with Node.js, refer this article.Prerequisites:NPM NodeApproachTo add data in JSON file using the node js 4 min read How to Push Data to Array Asynchronously & Save It in Node.js ? Node.js is a powerful environment for building scalable and efficient applications, and handling asynchronous operations is a key part of its design. A common requirement is to collect data asynchronously and store it in an array, followed by saving this data persistently, for instance, in a databas 7 min read Like