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
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
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 like this
Build an Interactive History Timeline with Era Bands and Clickable Event Cards
Get a single-file interactive timeline with color-coded era bands, zoom controls, keyboard navigation and expandable event cards, ready for a history lesson.
Build a Classroom Grade Distribution Infographic with Histogram and Quartiles
A single HTML file that turns an inline array of class scores into a histogram with mean and median markers, a box plot, stat cards and a plain-language summary.
Build a Color-Coded Parts of Speech Grammar Cheat Sheet in One HTML File
A prompt that builds an interactive grammar cheat sheet where every word in the example sentences is colored by part of speech, and hovering or tapping a word explains why it fits that category.
Build a Course Syllabus Roadmap Infographic with Weekly Deadline Badges
A prompt that produces an interactive one-page syllabus roadmap with week cards, quiz, project and exam badges, grade weights and a clickable detail panel.
Build a Flip-Card Science Vocabulary Infographic in a Single HTML File
You get a ready-to-open HTML page with twelve cell-biology vocabulary cards that flip to show a definition, a real example and an emoji icon, plus shuffle, reveal-all and keyboard controls.
Build a How a Bill Becomes a Law Branching Flowchart in a Single HTML File
Get a one-file interactive civics flowchart that traces a U.S. bill from introduction to law, showing every point where it can fail or be vetoed, with click-to-expand notes and a text outline.