HTML Table Generator
Generate HTML tables from rows and columns with optional thead, tfoot, striped rows, borders, hover effects, and responsive wrappers. Supports Tailwind CSS, Bootstrap, and plain HTML.
An HTML Table Generator is a specialized computational utility that translates raw, unstructured, or spreadsheet-formatted data into perfectly nested, semantic HyperText Markup Language (HTML) code. This concept is fundamentally critical to web development because manually writing the dozens of required structural tags for tabular data is highly susceptible to human error, incredibly time-consuming, and difficult to maintain across modern responsive design frameworks. By understanding the underlying mechanics of HTML tables and the generators that produce them, you will learn how to seamlessly transform complex datasets into accessible, mobile-friendly interfaces using industry-standard systems like Tailwind CSS and Bootstrap.
What It Is and Why It Matters
At its core, an HTML Table Generator acts as a translation engine between human-readable data and browser-readable markup. When you look at a spreadsheet containing 50 rows and 5 columns, you see a simple grid of 250 cells. However, a web browser requires a strictly defined hierarchy of HTML tags to render that exact same grid. Writing this by hand would require typing out a minimum of 500 individual opening and closing tags, carefully ensuring that no single bracket is missed or misplaced. A generator automates this exact process, taking an input like Comma-Separated Values (CSV) or JavaScript Object Notation (JSON) and programmatically wrapping each piece of data in its appropriate structural tag.
The existence of this concept solves a massive bottleneck in the web development and content publishing pipeline. Before automation, updating a simple pricing table on a website required a developer to manually comb through hundreds of lines of code to change a single digit, risking the structural integrity of the entire web page. Today, a generator allows a user to paste raw text and instantly receive production-ready code. This matters profoundly not just for speed, but for consistency. Modern web development relies heavily on CSS frameworks to make websites look good on both large desktop monitors and small smartphone screens. A generator ensures that the complex, specific class names required by these frameworks are applied uniformly across every single row and cell, guaranteeing a flawless visual presentation without the tedious labor.
Furthermore, the necessity of these generators extends deeply into the realm of web accessibility. For a visually impaired user relying on a screen reader, a table is not a visual grid; it is a sequence of audio cues. If the HTML is not formatted with exact semantic precision—using specific tags to denote headers versus standard data—the screen reader will read the data as a confusing, jumbled list. Generators solve this by automatically enforcing strict semantic rules, ensuring that the resulting markup complies with international accessibility laws. Anyone who publishes data to the internet, from a financial analyst sharing quarterly earnings to a blogger comparing digital camera specifications, relies on the principles of HTML table generation to make their information legible to both machines and humans.
History and Origin of HTML Tables
To understand modern table generation, one must look back at the chaotic evolution of web layout itself. When Sir Tim Berners-Lee invented HTML in 1991, the language did not include any mechanism for displaying tabular data. The web was initially designed purely for sharing linear scientific documents. As the internet expanded beyond academia, the demand for structured data display grew rapidly. In January 1997, the World Wide Web Consortium (W3C) officially introduced the <table> element as part of the HTML 3.2 specification. This was a monumental shift. For the first time, webmasters could create rigid, two-dimensional grids natively within the browser.
However, this invention quickly led to what web historians refer to as the "Dark Ages" of web design. Because CSS (Cascading Style Sheets) was still in its infancy and poorly supported by browsers like Internet Explorer 4 and Netscape Navigator, developers realized they could use invisible HTML tables to force page layouts. From roughly 1998 to 2004, almost every major website was built using massive, deeply nested tables, slicing images and text into invisible grid cells just to create sidebars and headers. This practice was disastrous for performance, as browsers had to wait for the entire table code to download before rendering anything on the screen. It also made the code nearly impossible to read or maintain.
The paradigm shifted dramatically with the widespread adoption of CSS in the mid-2000s, which stripped the table element of its layout duties and returned it to its original purpose: displaying tabular data. But a new problem arose with the invention of the smartphone in 2007. HTML tables are inherently rigid; a table with 10 columns will simply break out of the screen on a mobile device, forcing the user to scroll horizontally or zooming out until the text is microscopic. To solve this, developers created complex responsive CSS frameworks. In 2011, Twitter released Bootstrap, and in 2017, Tailwind CSS revolutionized utility-first styling. These frameworks required developers to add dozens of specific CSS classes to every single table element to make them responsive. Writing this markup manually became mathematically untenable, leading directly to the creation of modern HTML Table Generators, which dynamically apply these complex responsive classes to raw data in milliseconds.
Key Concepts and Terminology in Tabular Markup
To utilize or understand any table generation process, you must master the fundamental vocabulary of HTML tabular markup. The entire structure is wrapped in the <table> element, which acts as the foundational container. Inside this container, the data is not simply thrown in; it is strictly organized into semantic sections. The <thead> (Table Head) defines the top row or rows that contain the titles of your columns. The <tbody> (Table Body) encapsulates the actual primary data. Finally, the <tfoot> (Table Foot) is used for summary rows at the bottom, such as a "Total" row in a financial ledger.
Within these three primary sections, the data is organized strictly by rows, not columns. The <tr> (Table Row) tag defines a horizontal slice of the table. Inside the row, you place your individual cells. There are two types of cells: <th> (Table Header) and <td> (Table Data). A <th> element is used inside the <thead> to denote a column title, and browsers will naturally render this text as bold and centered. The <td> element is used inside the <tbody> to hold the actual information. Understanding this row-first architecture is critical because it dictates how data must be parsed and generated by any automated system.
Two of the most complex concepts in table generation are colspan and rowspan. These are attributes applied directly to a <th> or <td> tag that allow a single cell to stretch across multiple columns or rows, much like the "Merge Cells" feature in Microsoft Excel. For example, if you have a header titled "Q1 2024 Revenue" that needs to sit above three separate columns for January, February, and March, you would apply colspan="3" to that header cell. This tells the browser to allocate the spatial equivalent of three standard cells to this single element. Finally, the <caption> element acts as the official title of the table, sitting immediately inside the <table> tag but outside the <thead>. It provides essential context for screen readers, ensuring users know exactly what data the table contains before they begin navigating the individual cells.
How HTML Table Generation Works — Step by Step
The mechanical process of generating an HTML table from raw data is an exercise in precise string manipulation and algorithmic looping. To understand this, we must break down the exact sequence of events a computational generator performs. The process begins with data ingestion. Let us assume the input is a simple Comma-Separated Values (CSV) string containing three columns and two rows of data: "Name, Age, Role \n Alice, 30, Developer". The generator's first task is to parse this raw string into a two-dimensional array, which is a programmatic grid of data.
The parsing algorithm splits the input string by the newline character (\n) to determine the number of rows. In our example, this yields an array of two strings: ["Name, Age, Role", "Alice, 30, Developer"]. Next, the algorithm loops through each of these row strings and splits them by the comma character (,). This results in a final two-dimensional array: [["Name", "Age", "Role"], ["Alice", "30", "Developer"]]. Now that the data is structured computationally, the generator begins constructing the HTML string. It starts by initializing a variable with the opening <table> tag.
The generator must now apply logic to differentiate the header from the body. It takes the first array ["Name", "Age", "Role"] and wraps it in a <thead> and a <tr>. It then initiates a "for loop" to iterate over the three items. For each item, it wraps the text in <th> tags. The exact string concatenation looks like this: <th> + "Name" + </th>. Once the header loop finishes, it closes the <tr> and <thead> tags. The generator then opens a <tbody> tag and begins a secondary, nested loop for the remaining data. For the second array ["Alice", "30", "Developer"], it opens a <tr>, loops through the three items wrapping them in <td> tags, and closes the <tr>.
To calculate the exact computational output, we can use a simple formula. The number of generated DOM (Document Object Model) nodes $N$ for a basic table can be calculated as: $N = 1 (\text{table}) + 1 (\text{thead}) + 1 (\text{tr}) + C (\text{th}) + 1 (\text{tbody}) + R (\text{tr}) + (R \times C) (\text{td})$, where $C$ is the number of columns and $R$ is the number of data rows. For our example ($C=3, R=1$ data row), the calculation is: $1 + 1 + 1 + 3 + 1 + 1 + (1 \times 3) = 11$ distinct HTML nodes generated. By automating this mathematical looping, the generator ensures perfect syntactic closure, eliminating the possibility of a missing </td> tag that would otherwise break the entire visual layout of the webpage.
Types, Variations, and CSS Framework Integrations
HTML table generation is not a monolithic process; it varies wildly depending on the visual and architectural requirements of the target project. The most basic variation is the "Vanilla HTML" generator. This method produces raw, unstyled markup using only standard HTML tags. It relies entirely on the browser's default stylesheet, resulting in a primitive, 1990s-style appearance with rigid borders and Times New Roman text. While visually unappealing, vanilla generation is highly useful for developers who intend to write their own custom CSS from scratch, as it provides a clean, unopinionated foundation.
The second, and vastly more popular, variation is the "Bootstrap-Integrated" generator. Bootstrap is a globally recognized CSS framework that uses predefined class names to style elements. A Bootstrap table generator automatically injects specific classes directly into the HTML markup during the generation loop. For example, instead of outputting a bare <table> tag, it outputs <table class="table table-striped table-hover table-bordered">. This instantly applies a professional, modern aesthetic with alternating row colors (striped), interactive hover states, and clean borders. Furthermore, to make the table responsive, the generator will wrap the entire structure in a <div class="table-responsive">, ensuring that on mobile devices, the table scrolls horizontally rather than breaking the page layout.
The third major variation is the "Tailwind CSS" generator. Tailwind is a utility-first framework where developers apply micro-styles directly to the HTML rather than writing separate CSS files. A Tailwind table generator produces significantly more verbose HTML because it must apply utility classes to every single cell. Instead of a simple <th>, a Tailwind generator might output <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">. While this looks visually overwhelming in the code, it allows for unparalleled customization without ever writing a line of custom CSS. Finally, there are "Markdown-to-HTML" generators. Markdown uses simple text characters like pipes (|) and hyphens (-) to draw a table in plain text. The generator parses this specific syntax and translates it into HTML, a variation heavily used in documentation platforms like GitHub and technical blogs.
Real-World Examples and Applications
To grasp the true utility of automated table generation, we must examine concrete, real-world scenarios where manual coding would be prohibitively expensive or practically impossible. Consider a corporate financial analyst tasked with publishing a company's quarterly earnings report to the investor relations website. This dataset contains 4 quarters of data across 25 different financial metrics (revenue, operating costs, EBITDA, etc.), resulting in a grid of 26 rows (including headers) and 5 columns. This equates to 130 individual data cells. If a developer were to code this manually using Tailwind CSS, they would need to write over 400 lines of highly repetitive HTML, carefully pasting utility classes like border-b border-gray-200 onto every single <td> element. Using a generator, the analyst simply pastes the 130-cell Excel data into an interface, selects the "Tailwind" output option, and receives the flawless 400-line HTML string in less than 50 milliseconds.
Another highly practical application is the ubiquitous SaaS (Software as a Service) pricing table. Imagine a software company offering three tiers: "Basic ($9/mo)", "Pro ($29/mo)", and "Enterprise ($99/mo)". The marketing team wants to compare these tiers across 15 different software features using checkmarks and text. This requires a table with 16 rows and 4 columns. However, pricing tables require complex formatting; the header row must visually stand out, and certain rows might need colspan attributes to create section dividers (e.g., a row spanning all 4 columns that just says "Security Features"). A specialized generator allows the user to define these specific spans and apply distinct classes to the header row, transforming a complex marketing layout into precise structural HTML without requiring the marketing team to understand the intricacies of the colspan attribute.
A third example involves massive datasets, such as a sports statistics website displaying the historical batting averages of 500 baseball players. A table with 500 rows and 10 columns contains 5,000 individual data points. Manually typing the <tr> and <td> tags for 5,000 cells is beyond human capacity; it would take days and guarantee typographical errors. An automated generator processes this CSV file instantly. More importantly, advanced generators can automatically inject data- attributes into the HTML. For example, it might output <td data-sort="0.312">.312</td>. This invisible data attribute allows JavaScript libraries to seamlessly sort the 500 rows alphabetically or numerically when a user clicks the column header, proving that generated HTML is not just about visual display, but functional interactivity.
Common Mistakes and Misconceptions in Table Design
Despite the automation provided by generators, a fundamental misunderstanding of HTML tables leads to pervasive errors across the web. The single most egregious mistake—a leftover habit from the early 2000s—is using tables for page layout. Many beginners assume that if they want an image on the left and text on the right, they should generate a two-column table to hold them. This is a critical error. Tables are strictly semantic tools designed exclusively for tabular data (data that has logical relationships between rows and columns). Using a table for layout destroys web accessibility, as screen readers will attempt to read the layout structural elements as if they were a data spreadsheet, utterly confusing the visually impaired user. Modern layout must always be handled by CSS Flexbox or CSS Grid.
Another massive misconception involves the omission of the <thead> and <tbody> tags. Many novices believe that simply making the first row of text bold using the <b> tag or CSS is sufficient to create a header. They will generate a table containing only <tr> and <td> tags, manually styling the top row to look different. While this may look correct to a sighted user, it is semantically invalid. Without the specific <th> tags wrapped in a <thead>, browsers, search engine web crawlers, and assistive technologies cannot differentiate the column titles from the actual data. This severely penalizes the webpage's SEO (Search Engine Optimization) and accessibility scores.
A third common pitfall is the failure to account for mobile responsiveness during the generation phase. A beginner will often generate a perfectly valid HTML table with 8 columns, paste it into their website, and view it on their desktop monitor where it looks beautiful. However, when viewed on a 320-pixel-wide mobile screen, the table will forcefully break out of the website's container, causing the entire webpage to scroll horizontally or shrinking the text to an unreadable 4-pixel font size. The misconception is that HTML tables are inherently flexible. They are not. Tables possess a rigid minimum width dictated by the length of the longest unbreakable word in their cells. Failing to wrap the generated <table> in a responsive div with CSS properties like overflow-x: auto is a mistake that ruins the user experience for the majority of modern web traffic.
Best Practices and Expert Strategies for Responsive Tables
Achieving mastery in tabular data display requires adhering to strict professional best practices. The foremost expert strategy is the implementation of the "Responsive Wrapper" pattern. Because tables cannot cleanly collapse into a single column without complex JavaScript, the industry standard is to allow the table to scroll horizontally independently of the rest of the webpage. To achieve this, experts never place a <table> directly into the main document flow. Instead, they generate a parent container: <div style="overflow-x: auto; max-width: 100%;">. The table is placed inside this container. On a desktop, the wrapper does nothing. On a mobile device, the webpage remains fixed, but the user can swipe left and right exclusively within the table area to view the hidden columns, preserving the integrity of the site's layout.
Another critical best practice is the strategic use of text alignment and typography within the generated cells. Experts follow strict typographic rules for data readability. Numerical data—especially financial figures like "$1,250.00"—must always be right-aligned. This ensures that decimal points align perfectly in a vertical column, allowing the human eye to quickly compare magnitudes. Conversely, textual data, such as names or categories, should be left-aligned to match natural reading patterns. Column headers should always match the alignment of the data beneath them. When configuring a table generator, a professional will explicitly set these alignment classes (e.g., text-right in Tailwind) rather than relying on default browser behavior.
Furthermore, experts utilize visual grouping strategies for tables exceeding 10 rows. Staring at a massive grid of white cells causes "row drift," where the user's eye accidentally jumps to the row above or below as they read across a wide screen. To combat this, best practice dictates the use of "Zebra Striping." This involves applying a subtle background color (like a very light gray, #f9fafb) to every even-numbered <tr> element. Modern generators can handle this via CSS frameworks (like Bootstrap's .table-striped) or by using the CSS :nth-child(even) pseudo-class. Coupled with a hover effect that slightly darkens the row the user's mouse is currently resting on, these strategies drastically reduce cognitive load and improve data comprehension for the end user.
Accessibility Standards and Industry Benchmarks
In professional web development, accessibility is not an optional enhancement; it is a legal and ethical mandate governed by the Web Content Accessibility Guidelines (WCAG). When generating HTML tables, the markup must meet WCAG 2.1 Level AA standards. The most critical benchmark for table accessibility is the correct implementation of the scope attribute. When a screen reader navigates a table, the user needs to know which column and row headers apply to the cell they are currently on. To facilitate this, every <th> element in the header row must include scope="col". If the table has a vertical header (for example, the first column contains the names of employees), those specific <th> elements must include scope="row". This explicit scoping provides a mathematical grid reference for assistive technologies.
Contrast ratios are another heavily monitored industry benchmark. When generators apply CSS classes to table rows and headers, the contrast between the text color and the background color must be strictly calculated. According to WCAG 2.1, standard text (typically defined as anything under 18 points) must have a contrast ratio of at least 4.5:1 against its background. If a generator produces a table with white text (#ffffff) on a light gray header background (#cccccc), the contrast ratio is only 1.6:1, which is a catastrophic failure of accessibility standards. Professionals ensure that generated table headers utilize dark backgrounds (e.g., #1f2937) with white text, or light backgrounds with near-black text (#111827), ensuring compliance and legibility for users with visual impairments.
Finally, the inclusion of the <caption> element is a benchmark that distinguishes amateur markup from professional code. The caption acts as the accessible name for the table. When a screen reader encounters a table, it will read the caption first, giving the user the context to decide whether they want to spend the time navigating the data or skip past it entirely. Industry standards dictate that the caption should be concise but descriptive. For instance, instead of a caption that says "Sales", a compliant caption would read "Q3 2024 Regional Sales Figures by Product Category". A high-quality HTML table generator will always prompt the user to input a caption and will automatically nest it correctly as the very first child element immediately following the opening <table> tag.
Edge Cases, Limitations, and Pitfalls of HTML Tables
While HTML tables are robust, they possess severe limitations when pushed to their computational and visual extremes. The most significant edge case involves massive datasets. The Document Object Model (DOM) is the browser's internal representation of the webpage. Every single HTML tag generated is a node in the DOM. If a user attempts to generate and render a table with 10,000 rows and 20 columns, the generator will produce exactly 200,000 <td> nodes, plus rows and headers. Browsers like Chrome and Safari will struggle to render a DOM of this size. The webpage will freeze, scrolling will become incredibly laggy (dropping below the acceptable benchmark of 60 frames per second), and the browser tab may ultimately crash due to memory exhaustion. Pure HTML tables are simply not built to handle big data in a single render cycle.
Another major pitfall occurs with highly nested tables. While it is technically valid HTML to place an entire <table> inside the <td> of another table, this creates an exponential nightmare for both responsive design and accessibility. Screen readers become hopelessly lost trying to decipher the parent-child relationships of the grids, often reading the data entirely out of order. Visually, a nested table forces the parent cell to expand unpredictably, breaking the symmetrical alignment of the primary grid. Experienced developers consider nested tables to be a severe anti-pattern. If data requires a nested structure, it is a clear warning sign that the information should be flattened into a single, well-structured table, or broken apart into multiple distinct tables separated by standard headings.
A final limitation is the inability of pure HTML tables to handle complex responsiveness beyond simple horizontal scrolling. If a table contains massive blocks of text in a single cell (like a full paragraph describing a product feature), the table will force the column to be incredibly wide, overriding standard CSS width constraints. On mobile devices, this forces the user to scroll horizontally for an uncomfortably long time just to read one sentence. Because the <table> element enforces a strict relationship where all cells in a column must be the exact same width, a single cell with a long, unbreakable string (like a URL) will distort the entire column geometry. Generators cannot fix this inherent architectural limitation of the HTML specification; they can only apply CSS workarounds like word-break: break-all, which often looks visually unappealing.
Comparisons with Alternatives: Grid, Flexbox, and Data Grids
Understanding when not to use an HTML Table Generator is just as important as knowing how to use one. The most common alternative for layout purposes is CSS Grid. CSS Grid is a two-dimensional layout system that allows developers to create complex visual structures without the rigid semantic constraints of the <table> tag. If you are building a photo gallery, a dashboard layout, or a pricing tier where the items are distinct cards rather than a unified spreadsheet, you should use CSS Grid. Grid allows items to naturally wrap to the next line on smaller screens, offering vastly superior responsive capabilities. However, CSS Grid does not convey the semantic meaning of "tabular data" to screen readers. Therefore, if the data is a true spreadsheet (like a financial ledger), CSS Grid is an accessibility failure, and an HTML table is mandatory.
CSS Flexbox is another alternative, primarily used for one-dimensional layouts (either a single row or a single column). Flexbox is ideal for navigation menus, aligning buttons, or creating a list of items. Beginners sometimes try to build "fake tables" by creating a series of Flexbox rows. This approach is highly flawed because Flexbox does not inherently align columns across different rows. The text in row 1 might push its "column" wider than the text in row 2, resulting in a jagged, misaligned visual mess. HTML tables enforce strict vertical alignment across all rows natively, making them the superior choice when column alignment is the primary visual requirement.
For the massive datasets mentioned in the edge cases (e.g., 10,000+ rows), the industry standard alternative is a JavaScript-based "Data Grid" library, such as AG Grid or DataTables. Unlike a simple HTML table generator that outputs thousands of static DOM nodes, a Data Grid utilizes a technique called "DOM Virtualization." It only renders the 20 or 30 rows that are currently visible on the user's screen. As the user scrolls down, the JavaScript rapidly replaces the data inside those same 30 HTML nodes rather than creating new ones. This allows a Data Grid to handle millions of rows with zero performance lag. Furthermore, these libraries offer out-of-the-box sorting, filtering, and pagination. While an HTML table generator is perfect for static, read-only data up to a few hundred rows, a JavaScript Data Grid is the required alternative for enterprise-level, interactive data manipulation.
Frequently Asked Questions
Can I use an HTML Table Generator to create an email template?
Yes, but with extreme caution. HTML email development is notoriously archaic because email clients like Microsoft Outlook use incredibly outdated rendering engines (Outlook uses Microsoft Word's rendering engine). While modern web browsers support CSS frameworks like Tailwind and Bootstrap, email clients do not. If you are generating a table for an email, you must use a "Vanilla HTML" generator and ensure that all styling is applied via inline CSS (e.g., <td style="border: 1px solid black; padding: 10px;">). You must avoid complex responsive classes and rely on basic HTML attributes like width="100%" to ensure the table renders correctly across different email applications.
Why does my generated table look completely unstyled when I put it on my website?
If you use a generator that outputs Bootstrap or Tailwind CSS classes (like <table class="table-auto">), those classes will only work if your website actually has the corresponding CSS framework installed and configured. An HTML table generator does not generate the CSS file itself; it only generates the HTML markup containing the class names. If your website is built on standard WordPress without Tailwind installed, the browser will ignore the Tailwind classes, and the table will revert to the browser's default, unstyled appearance. You must ensure your generator's output matches your website's existing CSS architecture.
How do I make a generated HTML table searchable or sortable?
Pure HTML and CSS cannot perform search or sort functions; these require computational logic. An HTML table generator will only provide the static structural markup. To add interactivity, you must integrate a JavaScript library. The most common approach is to generate your static HTML table, give it a specific ID (e.g., <table id="myTable">), and then initialize a lightweight library like List.js or standard DataTables in your website's footer. The JavaScript will automatically read the semantic <thead> and <tbody> tags you generated and overlay interactive search boxes and clickable sorting arrows onto your static markup.
What is the difference between <th> and <td>?
The <th> tag stands for Table Header, while <td> stands for Table Data. Semantically, <th> is used to define the title or category of a column or row, whereas <td> contains the actual specific data points. Visually, most browsers will automatically render text inside a <th> as bold and center-aligned, while <td> text is rendered as regular weight and left-aligned. From an accessibility standpoint, screen readers use <th> tags as reference points to tell visually impaired users what category of data they are currently listening to. You should never use a <td> for a column title, and you should never use a <th> for standard data.
Is it bad practice to use inline styles instead of CSS classes in generated tables?
In modern web development, relying heavily on inline styles (e.g., <td style="color: red; font-size: 14px;">) is considered poor practice because it violates the principle of separating structure (HTML) from presentation (CSS). Inline styles make the HTML code bloated, harder to read, and incredibly difficult to update globally. If you need to change the padding on 500 table cells, inline styles require 500 manual edits. However, inline styles are still standard practice in two specific edge cases: HTML email templates (as mentioned above) and highly dynamic data where a specific color is calculated programmatically on the fly (like turning a cell red if a financial number is negative).
How many rows are too many for a standard HTML table? While there is no hard limit in the HTML specification, performance degradation becomes noticeable in standard browsers when a single table exceeds roughly 1,000 to 1,500 rows, depending on the number of columns and the complexity of the CSS applied. At this scale, the browser must calculate the geometry of thousands of interconnected DOM nodes simultaneously. If your dataset exceeds 1,000 rows, it is highly recommended to implement pagination (breaking the data into pages of 50-100 rows) or to abandon static HTML generation in favor of a virtualized JavaScript Data Grid that only renders the visible portion of the data to the screen.