Build an Interactive Periodic Table Infographic in a Single HTML File

Get a responsive periodic table of all 118 elements with family, state and metal-type filters and a detail panel for each element, in one HTML file.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
Act as a front-end developer and science-education designer. Build Element Atlas, an interactive periodic table infographic covering all 118 elements, as one self-contained HTML file. Each element stores its symbol, name, atomic number, atomic mass, family, state at 20 °C and metal type. Derive table positions from atomic number, and place the lanthanides and actinides in two separated rows below the main grid.

Rules:
1. Layout: an 18-column CSS grid of tile buttons colored by family. Put a short how-to-read-a-tile key in the empty top gap. Show a detail panel beside the table on wide screens and above it on narrow ones. The table scrolls sideways below 720px.
2. Filters: three chip rows for family (doubling as the color legend), state (solid, liquid, gas, unknown) and type (metal, metalloid, nonmetal). Filters combine, non-matching tiles dim, and a live count and a reset button update with them.
3. Detail panel: a large tile, name, family, a property list (number, mass, state, type, period, group, block), a family description, a fun fact for well-known elements, and previous/next buttons. Select Carbon on load.
4. Controls: mouse, touch, and arrow keys that move between tiles, with visible focus rings.
5. Style: warm off-white background, dark ink text, ten soft pastel family colors with strong contrast, and system fonts. Disable the hover lift under prefers-reduced-motion.
6. No external libraries, fonts, images, storage or network calls.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Element Atlas, an interactive periodic table of all 118 elements.

The page opens with Carbon selected. Click or tap any tile to see its mass, state, family, period, group and block, plus a fun fact for well-known elements. Use the colored family chips, state chips and type chips to dim everything that doesn't match. For example, try Liquid to find Bromine and Mercury. Focus a tile and use the arrow keys to move around the table.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Deriving grid positions and families from the atomic number keeps the data compact and makes misplaced tiles unlikely.
  • Family chips double as the color legend, so filtering and reading the key happen in one place.
  • A fixed minimum table width with sideways scroll keeps all 18 columns legible on phones instead of squeezing the tiles.

Paste into ChatGPT, Claude or Gemini. Save the returned code as periodic-table.html and open it in any browser, or view it in the chat's preview or canvas panel.

Common edits

  • Swap the pastel palette for a dark theme by changing the CSS color variables at the top of the style block.
  • Add more properties, such as electronegativity or melting point, as extra fields in the data string and rows in the detail list.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Infographics