Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 21 Oct 2026 - @893.08
Forum Activity: Four Stars Random | Recent Posts | Guild Recents
News: There's a great big indie web tomorrow! :smile: Guild Events: Weekly zine jam 17: Fashion
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ Web Crafting
| | |-+  Wide table on a phone, what do you do with it?


« previous next »
Pages: [1] Print Embed
Author Topic: Wide table on a phone, what do you do with it?  (Read 105 times)
ThembalethuJongile
Newbie ⚓︎
*
View Profile WWW

learning HTML one tag at a time
⛺︎ My Room

Artifacts:
Joined 2026!
« on: Autumn, 20 Oct 2026 @457 » Embed

Hi, newbie question. My first page is a table of the football grounds I've visited: name, town, year I first went, capacity and a short note. On my laptop it looks fine. On my phone the note column squashes everything else, the words in the first column break in half and you have to zoom out to read anything.

I'm doing everything by hand, no frameworks, just one HTML file and one CSS file. Things I've found so far:

- wrapping the table in a div with overflow-x: auto so it scrolls sideways
- a media query that turns each row into a little block, with the column name written in front of each cell
- just cutting the note column on small screens

The scrolling one was easy and works, but sideways scrolling on a phone feels clumsy. The blocks version looks nicer in the examples I saw, but it seems to need the column names repeated in every cell with data attributes, which is a lot of typing for 40 rows.

What do you all do for tables on your sites? Is there a simple way I'm missing, or is it normal to just let it scroll?

Logged
Dan Q
Hero Member ⚓︎
*****
View Profile WWWArt


I have no idea what I am doing
⛺︎ My Room
RSS: RSS

Guild Memberships:
Artifacts:
The Worm is creeping around Melonland profiles!Dan Q Cruisin'I DIDN'T meet Dan Q on Melonland!Visited on Melon's 10th Anniversary!
« Reply #1 on: Autumn, 20 Oct 2026 @506 » Toggle Font Embed

Hiding information is bad (unless users can opt-in to seeing it!)

Not option 3! Hiding information on mobiles is the most-annoying solution. Although you could dynamically hide, I suppose, with a checkbox to show the missing data at the expense of side-scrolling, with some CSS like:


Code
/* When the <input type="checkbox" id="show-notes-column-checkbox"> is NOT checked,
 * we hide all the <td class="notes-column">s:
 */
body:not(:has(#show-notes-column-checkbox:checked)) .notes-column {
  display: none;
}

I like media queries!

My personal preference would be a media query, but it's more work than side-scrolling so only do it if it feels "worth it" to you. You could collapse each row into a "card" about the place you visited. Something like this: everyone.melonland.net/media-query-table-shrinking

Logged

https://danq.me/_q26t/badges/dan-q-88x31-lighter.gif https://danq.me/_q26t/badges/dan-q-88x31-peekaboo-scroller.gif https://beige-buttons.danq.dev/beige-buttons-88x31.gif https://embed-html.danq.dev/embed-html-88x31.gif https://origami.danq.dev/88x31.gif

Artifact Swap: PolyamorousI met Dan Q on Melonland!Joined 2025!
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 Melon
Land
Forum Art Hub Chat Webring Explore Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online
Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe