Web Design Industry: "Don't use tables for page layouts. You should use divs and CSS table selectors instead"

Me: *Spends two days straight trying to get divs in a table layout to line up properly without doing stupid shit like wrapping to the next line or getting the width of the container divs to behave properly*

Me: "Fuck it I'm using tables"

Me: *Has page layouts working as intended in 20 minutes*


@zalasur I think the webdev community takes this rule too far. If you're building tables, <table> is literally designed for it 🤷‍♂️

@PsychoLlama Technically I'm not making a table. I just need a row of elements that don't wrap, obey certain constraints with regards to worth and overflow. I thought these were basic problems to solve in modern HTML but after two days of not making any progress, I decided that the ol' trusty tables was the way to go. And it was.

@zalasur So you reverted to html <tables>? Did you try at least CSS display: table and related?

@Neui as I mentioned in my original post, divs with table-related CSS was what I had been attempting to implement for two days.

@zalasur rather than trying to use table display modes, did you try flexbox or cash grid? They make most applications like what you describe trivial.

@jwkicklighter not yet familiar enough with those types of CSS layouts and I'm sort of on a deadline. Soon. :^)

@zalasur oh man, you're missing out. The advice to not use a table for page layouts is absolutely correct. A <table> is meant to represent tabular data for all sorts of reasons (including accessibility tools).

Check out and you'll know flexbox in less than an hour.

I hope it doesn't seem like people are beating you up about using a table. There are reasons to use specific html elements, and CSS is actually very powerful. We just want to help!

@zalasur eh, that's fine too. No judgment here 🙂

> I thought these were basic problems to solve in modern HTML [...]

Often, yes. Flexbox and CSS Grid are modern marvels, but they can be cruel masters. The tiniest thing anywhere on the page can break your layout or you might be missing an obscure setting 20 elements up the tree. And some layouts are just plain hard.

It gets easier once Stockholm Syndrome sets in.

@PsychoLlama For me it was finding 1000 needles in a giant haystack. I'd solve one problem, only for 10 more to pop up. It got to the point where I asked, "Why am I doing this to myself?"

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!