{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Making Basic Tables with Plotly" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Tables serve as a powerful complement to graphs and charts, providing a clear and structured way to present concrete data values. While visual elements like bar charts or scatter plots offer quick insights and trends at a glance, data tables cater to those who need exact numbers, summaries, detailed comparisons, or access to raw data alongside visual illustrations. \n", "\n", "Plotly, makes it simple to integrate such tables directly into your projects using the `go.Table` function. The `go.Table` function in Plotly allows for the creation of richly styled tables, enabling customization of fonts, colors, borders, and even conditional formatting. This flexibility ensures that your tables can be tailored to match the design of your visualizations while highlighting key insights effectively. \n", "\n", "Adding data tables alongside visualizations not only aids in storytelling but also provides context, allowing users to explore and verify the data underlying the visual trends. In this recipe, we'll walk you through the steps to create a clean and interactive data table using `go.Table`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting ready" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For this recipe we will create a small data set of student names and marks." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df = pd.DataFrame({'Names':['Ana', 'Bert', 'Charlie', 'David'], 'Marks' : [95, 85, 75, 95]})" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Names | \n", "Marks | \n", "
---|---|---|
0 | \n", "Ana | \n", "95 | \n", "
1 | \n", "Bert | \n", "85 | \n", "
2 | \n", "Charlie | \n", "75 | \n", "
3 | \n", "David | \n", "95 | \n", "