News for hackers. Stuff that matters.
Re:10 Weird HTML Hacks That Shaped the Internet by fifilura on Friday December 01, 2023 @07:42AM (#38486047)
Using tables for layout is pretty understandable.

But when tables went out of fashion it was all about using floats for layout for a few years. That was wild, I am surprised it was left out from that list.

https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layou...

"Originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layouts on webpages. With the advent of flexbox and grid it's now returned to its original purpose, as this article explains."

Re:10 Weird HTML Hacks That Shaped the Internet by city41 on Friday December 01, 2023 @07:54AM (#38486124)
The era between tables and flexbox/grid was a difficult one. Floats were finicky and hard to get right. A lot of people just went back to tables, and I honestly didn't blame them.
Re:10 Weird HTML Hacks That Shaped the Internet by kalleboo on Friday December 01, 2023 @08:00AM (#38486174)
Or the rare-in-the-wild but somewhat funky method of using the display: table/table-row/table-cell CSS declarations to create table-based designs, but applied to different tags so at least your HTML still only shows those fancy modern divs :)
Re:10 Weird HTML Hacks That Shaped the Internet by chrisfinazzo on Friday December 01, 2023 @09:39AM (#38487165)
I had an internship during college at a small web shop that did a ton of HTML mail. Early on, after I had completed a project, they took a half day to try and teach me how floats worked.

Note: If you think web browsers are weird, just wait until you try doing things in email clients or - $deity forbid - ebook readers.

As you say, it was weird and initially quite difficult to wrap my head around it. Surprisingly, I didn't actually learn about the "clearfix" hack until a couple of years later when I interviewed for a Front-End job at - of all places - Fox News.

The person who I talked with there gave me a take-home to work on and send back. Tl;dr I didn't get it quite right because I hadn't really taken the time to understand what the particular styles did to the layout.

Fast-forward to today and I'm using floats w/ @print and a div class of "clearfix" set to "both" in order to reset the layout of a document that was converted from Word's .docx to HTML.

How times change.

Re:10 Weird HTML Hacks That Shaped the Internet by rchaud on Friday December 01, 2023 @10:19AM (#38487723)
The era between tables and flexbox/grid were the glory years of Bootstrap and Foundation CSS frameworks.
Re:10 Weird HTML Hacks That Shaped the Internet by jart on Friday December 01, 2023 @08:23AM (#38486369)
Floating divs killed the Dreamweaver. CSS came and broke your heart. Oh, a, a, a, oh.
Re:10 Weird HTML Hacks That Shaped the Internet by xyzzy_plugh on Friday December 01, 2023 @11:11AM (#38488348)
We browse through Wayback and it seems so long ago...

I met your children -- what did you tell them?

Re:10 Weird HTML Hacks That Shaped the Internet by sgc on Friday December 01, 2023 @04:59PM (#38493070)
I told them to behave, but I don't know if they listened, because my old ears are plugged up, and I can only barely hear them. Hee dee hee, hee dee ho
Re:10 Weird HTML Hacks That Shaped the Internet by CM30 on Friday December 01, 2023 @08:46AM (#38486576)
Speaking of floats being used for layout, you could probably add the clearfix hack to this list too.

That was an essential part of my CSS toolbox for years, and something that ended up being one of the first things added in every new project.

https://css-tricks.com/snippets/css/clear-fix/

Re:10 Weird HTML Hacks That Shaped the Internet by cantSpellSober on Friday December 01, 2023 @08:57AM (#38486682)
The linked article includes an example of the "commented backslash hack," a variation on point #3 in this article

Fell out of use because "nobody uses IE for Mac" :)

Re:10 Weird HTML Hacks That Shaped the Internet by dylan604 on Friday December 01, 2023 @10:27AM (#38487830)
IE for Mac was so atrocious, there's a chapter dedicated to it in iWoz.
Re:10 Weird HTML Hacks That Shaped the Internet by chrisfinazzo on Friday December 01, 2023 @05:53PM (#38493686)
As I understand it - I was a bit young when it happened, so all I have are secondhand accounts - IE 5 on Mac was substantially better that other browsers due in part to its CSS support.
Re:10 Weird HTML Hacks That Shaped the Internet by dylan604 on Saturday December 02, 2023 @09:54AM (#38498993)
The chapter on IE for Mac in iWoz has nothing to do with how the browser render engine worked. It is about how the OS behaved after it was installed.
Re:10 Weird HTML Hacks That Shaped the Internet by asadotzler on Friday December 01, 2023 @07:45PM (#38494627)
Tasman was way ahead of Trident actually. It had many problems Gecko had in that the web didn't care much for standards so implementing the standards, even well, wasn't considered a selling point. It was years of mostly Mozilla effort to make standards matter enough that web developers came around to them and then Tasman was viewed as an amazing pioneer alongside Gecko.
Re:10 Weird HTML Hacks That Shaped the Internet by Klonoar on Friday December 01, 2023 @03:49PM (#38492163)
It amazes me to this day that IE for Mac wasn't even the Trident rendering engine.
Re:10 Weird HTML Hacks That Shaped the Internet by asadotzler on Friday December 01, 2023 @07:43PM (#38494612)
While at Mozilla for a quarter century, I got to work for many years with one of the people who made Tasman, Mac IE's engine. It was a phenomenal engine from what I learned. I wasn't on Macs in that era so didn't use it much, but knowing today what I've learned about it, I believe it to be one of the better pieces of software Microsoft people ever built.
Re:10 Weird HTML Hacks That Shaped the Internet by cantSpellSober on Friday December 01, 2023 @08:53AM (#38486635)
> it was all about using floats for layout for a few years

Called these "faux columns" and a basic 3-column layout was so difficult it was referred to as the "holy grail" of layouts

https://en.wikipedia.org/wiki/Holy_grail_(web_design)#Faux_c...

Re:10 Weird HTML Hacks That Shaped the Internet by dylan604 on Friday December 01, 2023 @10:22AM (#38487752)
don't forget that the holy grail was to have a locked in header and footer with the middle section as scrollable 3 columns
Re:10 Weird HTML Hacks That Shaped the Internet by xyzzy_plugh on Friday December 01, 2023 @11:09AM (#38488323)
This is firmly cemented in my mind as completely impossible. I won't listen to reason.
Re:10 Weird HTML Hacks That Shaped the Internet by stabbles on Friday December 01, 2023 @12:23PM (#38489355)
It because of this exact technical challenge that ads nowadays appear between paragraphs in the middle content column, instead of in the right column where they belong.
Re:10 Weird HTML Hacks That Shaped the Internet by dylan604 on Friday December 01, 2023 @12:55PM (#38489836)
never underestimate the levels ad tech will stoop to interfere in an attempt to gain even more eyeballs/clicks. your attempt to sit them at the table in the back of the room next to the kitchen was never going to be the final placement
Re:10 Weird HTML Hacks That Shaped the Internet by Dalewyn on Friday December 01, 2023 @01:07PM (#38490040)
I will go a step further and argue that all the websites we see today with dropdown menus at the top, a huge header image below it, one blob of disjointed content(?) below that, and finally the footer at the end is(was?) a direct result of the Holy Grail being so difficult to achieve outside of using tables.
Re:10 Weird HTML Hacks That Shaped the Internet by chrisfinazzo on Friday December 01, 2023 @09:27AM (#38487031)
If you're specifying @screen as the Media Type, the primary reason I can think of for going back to floats is art direction - especially if you wanted to float images alongside a block of text. I know there are "better" methods in more modern versions of the spec, but this is one that still seems to get a fair bit of use.

Old CSS never dies, it just goes to live on a very special farm upstate where it only has to do 1 or 2 jobs.

Re:10 Weird HTML Hacks That Shaped the Internet by stabbles on Friday December 01, 2023 @09:37AM (#38487141)
As W3Schools still likes to call it: the new, modern clearfix hack [1]

    .clearfix::after {
      content: "";
      clear: both;
      display: table;
    }
[1] https://www.w3schools.com/howto/howto_css_clearfix.asp
Re:10 Weird HTML Hacks That Shaped the Internet by reddalo on Friday December 01, 2023 @09:54AM (#38487381)
W3Schools is a horrible resource. I'd like Google to hide all of their results.
Re:10 Weird HTML Hacks That Shaped the Internet by rchaud on Friday December 01, 2023 @10:18AM (#38487708)
A lot of people on HN seem to have this opinion. A lot of the content on that site has been re-written, and it's now a pretty fantastic resource for beginners.

If you tell 2 beginners to build something with PHP/jQuery/JS, and send one person to W3Schools and the other to PHP.net/jquery.org/MDN, I have no doubt that the W3schools person will get something done in workable state faster.

Re:10 Weird HTML Hacks That Shaped the Internet by jorgesborges on Friday December 01, 2023 @12:32PM (#38489472)
What would be the point of that exercise though? It's true they might produce something faster, but if those sources are meant to be an educational resource then they'll learn more reading through actual documentation than copy-pasting questionable code to get something done.
Re:10 Weird HTML Hacks That Shaped the Internet by Tijdreiziger on Friday December 01, 2023 @01:44PM (#38490550)
You need a ‘tutorial’-style guide to bootstrap your knowledge. After that, you’re ready to use a technical reference.

Some programming languages ship a good tutorial as part of their documentation (e.g. Python), but not all.

Re:10 Weird HTML Hacks That Shaped the Internet by creatonez on Friday December 01, 2023 @11:21AM (#38488465)
I haven't noticed a difference since I first heard of the site. They may have corrected factual inaccuracies, but the overall organization and prioritization of information is not for me.
Re:10 Weird HTML Hacks That Shaped the Internet by anarazel on Friday December 01, 2023 @12:02PM (#38489074)
My main issue with them is not their content proper, but that their SEO ranks them above much more topical results. That's clearly also Google's fault, but it's also clearly w3school's strategy.
Re:10 Weird HTML Hacks That Shaped the Internet by woodrowbarlow on Friday December 01, 2023 @10:42AM (#38488026)
i'm mostly upset that they use "w3" in their name to masquerade as an "official" source of documentation. i know their about page clears this up, but it's pretty buried.
Re:10 Weird HTML Hacks That Shaped the Internet by rchaud on Friday December 01, 2023 @11:31AM (#38488618)
Well perhaps W3C's official site would rank higher if it actually offered any tutorials, i.e. the thing people are searching for, as opposed to a list of specifications and draft specifications that won't be finalized for 10 years.

In any case, "W3" is just another representation of 'www', which the W3C doesn't have any kind of claim over.

OpenAI isn't open. W3Schools is unaffiliated with the W3C. The world keeps spinning.

Re:10 Weird HTML Hacks That Shaped the Internet by explaininjs on Friday December 01, 2023 @01:13PM (#38490119)
> won't be finalized for 10 years

That's optimistic, optimistically. It's a group of ivory tower academics with no stake in any browser implementation acting like they have any right to tell actual browser implementors how to behave.

Re:10 Weird HTML Hacks That Shaped the Internet by reddalo on Friday December 01, 2023 @03:49PM (#38492172)
> acting like they have any right to tell actual browser implementors how to behave

Well, I totally prefer that, than letting Google decide by themselves

Re:10 Weird HTML Hacks That Shaped the Internet by explaininjs on Friday December 01, 2023 @04:29PM (#38492711)
Have you ever had academics that have nothing to do with you, your company, or your product, tell you how to do your job?

And besides, what makes you think Google listens to them?

Re:10 Weird HTML Hacks That Shaped the Internet by SkeuomorphicBee on Friday December 01, 2023 @12:36PM (#38489526)
I disagree, "w3" doesn't have any official connotation, it is literally the name of the thing they are teaching (or the alternate spelling of the abbreviation, but same thing). It is a common pattern for a school that teaches [thing] to call themselves "[thing] school", nothing wrong there.
Re:10 Weird HTML Hacks That Shaped the Internet by zlg_codes on Friday December 01, 2023 @03:17PM (#38491716)
You're telling me it's unreasonable for people to mix up W3schools and W3C? lol
Re:10 Weird HTML Hacks That Shaped the Internet by reddalo on Friday December 01, 2023 @03:50PM (#38492183)
I agree with you.

The name is so confusing that if you search for "w3c" on DuckDuckGo, the first result is W3Schools, and then the official W3C website.

Re:10 Weird HTML Hacks That Shaped the Internet by mpixel on Friday December 01, 2023 @10:22AM (#38487755)
And if you tell 2 experts to build something with W3Schools as the resource against better documentation, I'm sure the results will be the opposite.

That's not the point though, I'm not going to say different strokes for different folks.

Instead I'd say, if that beginner uses the 'slower' path instead, that will pay dividends in time -- they are better of learning to use the docs than getting paid peanuts for delivering that project which depends on the juniors faster.

Re:10 Weird HTML Hacks That Shaped the Internet by subtra3t on Friday December 01, 2023 @10:31AM (#38487884)
I disagree with you. "Learning" to use a particular documentation website (which, mindyou, changes its layout frequently) is not very time consuming.

So a beginner should use w3schools while they see fit, and then move on to MDN, etc. when they find it to be unsuitable for their purposes.

Re:10 Weird HTML Hacks That Shaped the Internet by rchaud on Friday December 01, 2023 @11:28AM (#38488570)
That's exactly what the progression was for me. W3S laid the foundations, and then I went on to MDN and other sources once I felt more comfortable.
Re:10 Weird HTML Hacks That Shaped the Internet by rchaud on Friday December 01, 2023 @11:26AM (#38488537)
An expert wouldn't go to W3schools to begin with. They would have far more specific problems that would be better explored on Stack Overflow.

A beginner on the other hand would have their SO questions locked/closed within minutes because it would likely break any one of the thousand little rules SO has (to reduce duplicates) that are unknown to beginners.

Horses for courses; I read the official MDN and PHP docs now, but I didn't when I began because those sites assume an enormous amount of prior knowledge about programming.

Re:10 Weird HTML Hacks That Shaped the Internet by account-5 on Friday December 01, 2023 @12:31PM (#38489463)
This exactly. I still look to w3school over mdn if I can. The information is just friendlier. I'll use "proper" documentation if needed and never post anything to SO for the reasons you state.
Re:10 Weird HTML Hacks That Shaped the Internet by rand_flip_bit on Friday December 01, 2023 @10:25AM (#38487790)
Amongst many other sites, I have w3schools blocked in my Kagi search results, along with MDN being raised/prioritized.

From the looks of it, it seems like blocking w3schools is quite popular among Kagi users [1].

[1]: https://kagi.com/stats

Re:10 Weird HTML Hacks That Shaped the Internet by chinkinthearmor on Friday December 01, 2023 @03:00PM (#38491481)
Could I ask real quick why you dislike W3Schools? I def learned SQL syntax and basic HTML/CSS (I needed to use CSS selectors but had basically no knowledge) through them and actually thought to myself they did a great job at keeping things need-to-know for immediate use.

I have a feeling I know your answer - as a financial professional I initially used Investopedia in a pinch but over the years realized their accuracy has an inverse relation with the specificity of the topic. After seeing incorrect formulas and descriptions a handful of times, I eventually stopped using it completely.

Re:10 Weird HTML Hacks That Shaped the Internet by reddalo on Friday December 01, 2023 @03:51PM (#38492206)
Kagi, what an unfortunate name. It means "you take a shit" in Italian :(
Re:10 Weird HTML Hacks That Shaped the Internet by paradox460 on Friday December 01, 2023 @02:04PM (#38490779)
Kagi let's you hide it.
Re:10 Weird HTML Hacks That Shaped the Internet by ransom1538 on Friday December 01, 2023 @11:57AM (#38488993)
 That works?  
Re:10 Weird HTML Hacks That Shaped the Internet by joshstrange on Friday December 01, 2023 @09:47AM (#38487264)
When floats first came out (or around that time) I wrote my computer repair site using them, all developed in FF. Then, as I was finishing, I opened it in IE and watched the entire design fall apart. Unfortunately the people I would be targeting with my website would almost certainly be using IE so I had to go back to the drawing board and rewrite it using tables. It was a sad day.
Re:10 Weird HTML Hacks That Shaped the Internet by yread on Friday December 01, 2023 @04:09PM (#38492430)
Unfortunately, the opposite could also happen. You just needed to test every commit (or check in... ugh writing that word brought back painful memories) in different browsers
Re:10 Weird HTML Hacks That Shaped the Internet by _fat_santa on Friday December 01, 2023 @09:58AM (#38487432)
I had to develop some email templates a while back for the first time and was almost shocked that they still use the "tables method" for layouts. Overall I'd say developing email templates now is much like developing websites in the early 2000's, email clients have such a wider range of CSS support that there are hacks all around. We now have frameworks like MJML and Foundation that do their best to abstract all that stuff away through components but take a look under the hood at the rendered HTML and it's a very scary and nostalgic place.
Re:10 Weird HTML Hacks That Shaped the Internet by dylan604 on Friday December 01, 2023 @10:26AM (#38487812)
But if you wrote an email template app based on tables, why would you change it if it's not broken? Why would you go through the hassle and expense of redeveloping your app just to not use tables? No sane person looks at the HTML of an email. Only poor souls that get a request on how to send email spam in-house might ever consider it, or just the perversely curious. Either way, nobody cares what it looks like under the hood as long as it looks good when viewed in the client.
Re:10 Weird HTML Hacks That Shaped the Internet by epiccoleman on Friday December 01, 2023 @10:46AM (#38488100)
I JUST had this same issue. Even worse, the Sendgrid "sample renderer" supports flex, but Gmail doesn't, so I didn't notice there was a problem until I started sending myself test emails, and then had to rewrite the whole template with tables.

Madness!

Re:10 Weird HTML Hacks That Shaped the Internet by zlg_codes on Friday December 01, 2023 @03:22PM (#38491801)
E-mail was never meant to support HTML, though, and it's a major vector for attacks. I wish more servers would disallow or strip HTML from their incoming messages.

Generally speaking, if I see an HTML e-mail I know the other end cares NOTHING about security or efficiency, and is actively trying to snoop on me with analytics.

Not surprising you had to fall back to very old HTML to hit a common featureset.

Re:10 Weird HTML Hacks That Shaped the Internet by chrisfinazzo on Friday December 01, 2023 @05:50PM (#38493653)
As I’ve been converting from .docx to HTML, I was pleasantly surprised to find that using flexbox to lay out three elements in a single row is perfectly fine and - bonus points- the CSS doesn’t make want to gouge my eyes out.

To your point that HTML can be a security risk, I remember interviewing at The College Board in mid 2011 and finding out that they still sent critical information - think testing admission tickets - with a MIME type of text/plain.

If you need to guarantee delivery and readability, no matter where people are getting the message, I don’t see how you can do it any other way.

Re:10 Weird HTML Hacks That Shaped the Internet by hn_throwaway_99 on Friday December 01, 2023 @11:21AM (#38488472)
I was going to comment that I took offense to calling table-based layout a hack in the first place. When tables went out of favor, and I saw many, many front end dev teams waste cumulative months of time creating a much less understandable web page fiddling with float nonsense all over the place, solely so "purists" could keep their religion in tact, I learned a valuable lesson. Joel Spolsky calls them "Architecture Astronauts" in a great blog post - the types of developers who forget that their job is to actually produce working software that does something well with the least amount of effort (architecture astronauts also gave us the ridiculousness of the first EJB spec, and stuff like the widely derided AbstractFactoryBuilderConstructor nonsense from Java). I feel like I've done a good job over time recognizing these architecture astronaut personalities and staying far away.
Re:10 Weird HTML Hacks That Shaped the Internet by jenscow on Friday December 01, 2023 @11:35AM (#38488686)
For sure. While tables went out of fashion, there was nothing usable to replace them.

I was not really interested if those doing a "View Source" are going to be offended by my "incorrect" use of tables.

Re:10 Weird HTML Hacks That Shaped the Internet by Izkata on Friday December 01, 2023 @05:57PM (#38493740)
Check out a "View Source" on HN ;)
Re:10 Weird HTML Hacks That Shaped the Internet by ghusbands on Friday December 01, 2023 @01:53PM (#38490657)
Not everyone who cares about accessibility is an architecture astronaut.
Re:10 Weird HTML Hacks That Shaped the Internet by handy2000 on Friday December 01, 2023 @03:03PM (#38491525)
IIRC non-table based layouts are rendered progressively, while table-based layouts have to be loaded fully first, and only then rendered. At the point when this was relevant, the Web was slow (slow connections, slow rendering engines), so one of the primary motivations for ditching tables for layouts was an increase in the perceived page rendering speed, not just a purist quirk.
Re:10 Weird HTML Hacks That Shaped the Internet by slapo on Friday December 01, 2023 @04:23PM (#38492634)
I don't think that's accurate. It was old Internet Explorer that wouldn't render tables progressively.

See here, where it includes a demo: https://www.vbulletin.org/forum/showthread.php?t=161099

Non-table layouts also came into fashion when screen resolutions started to vary more, and some degree of fluidity and responsiveness could've been implemented with non-table layouts while IE was still a target. However, IE was lacking so badly even with IE8 that a lot of CSS that had been a W3C recommendation for years at that point just either didn't work, it was quirky because IE handled the box model a little differently. Ít was one of the reasons why Javascript shims and IE-specific CSS had to help out fairly often.

Re:10 Weird HTML Hacks That Shaped the Internet by dspillett on Friday December 01, 2023 @06:32PM (#38494059)
> I don't think that's accurate. It was old Internet Explorer that wouldn't render tables progressively.

IIRC Netscape didn't either around the IE4/5 days. It also had significant performance problems with large sets of nested tables which IE6 (and perhaps IE5) did not.

For example back at University on 133MHz Pentium-class CPUs a large slashdot page with all threads open could take minutes to render where IE took merely a noticeable number of seconds - a co-student use to make a big thing of this as a reason to dump other browsers and use IE. There was actually a use case for this away from the University's fixed line connection: on dial up you could, RAM+swap and browser-not-crashing permitting, open a couple of windows like that then disconnect the modem and read at your leisure without racking up a per-minute phone bill.

Or maybe NS was capable of progressive display and this was just hidden in extreme cases by the performance issue, that was a time ago and memory is hazy…

Re:10 Weird HTML Hacks That Shaped the Internet by slapo on Monday December 04, 2023 @06:42PM (#38524883)
I haven't worked with Netscape that old, only some time after it became free of charge, but I remember it was really slow at just about anything compared to IE 5.5 and 6 - startup, rendering, UI. To the point that even if it could render tables progressively, it wouldn't really matter on my computer (which I think was either an Intel Penium II or an AMD Duron 850), despite only having a dial-up connection.

I think it was around the time of Firefox 1.6 when it felt like it was about on par with IE 6 in rendering speed for me, after tweaking some of its settings. I think it was also rendering tables progressively at the time.

Re:10 Weird HTML Hacks That Shaped the Internet by handy2000 on Friday December 01, 2023 @04:30PM (#38492719)
> I don't think that's accurate. It was old Internet Explorer that wouldn't render tables progressively.

You both agree and disagree with my comment :)

If memory serves me right, I started migrating off table layouts at the time when IE6 was still by far the most popular browser (>80% of the market?).

Re:10 Weird HTML Hacks That Shaped the Internet by wayfinder on Friday December 01, 2023 @07:14PM (#38494415)
IE had a setting that forced tables to render progressively. They documented it on the Microsoft web dev site and also I’m reasonably sure in their “cool things you can do in IE5.5” book.
Re:10 Weird HTML Hacks That Shaped the Internet by handy2000 on Friday December 01, 2023 @07:51PM (#38494663)
Didn't know that! Wonder what made them choose to turn this off by default. Must be an interesting eng story.
Re:10 Weird HTML Hacks That Shaped the Internet by wayfinder on Saturday December 02, 2023 @12:57AM (#38496311)
I used it and it almost progressively updated too often - like cell by cell, so it wasn’t very pretty. So you kind of had to know when to use it and when not to.
Re:10 Weird HTML Hacks That Shaped the Internet by slapo on Monday December 04, 2023 @06:25PM (#38524679)
So did I, but at the time, screen resolutions were starting to vary more.

It was probably a case of killing several birds with one stone - make layouts fluid while avoiding IE's issues with rendering tables.

Re:10 Weird HTML Hacks That Shaped the Internet by _jal on Friday December 01, 2023 @06:41PM (#38494145)
If you added attributes for the number of rows and columns (something like <table ... rows="4" cols="4">), it could render it progressively.

I don't recall if that was vanilla HTML or vendor extension, I suspect not vanilla.

I stopped doing front end work about the time tables for layout went out of fashion, my dorky internal tools still use them.

Re:10 Weird HTML Hacks That Shaped the Internet by handy2000 on Friday December 01, 2023 @07:56PM (#38494692)
Not in the HTML 4.01 spec (https://www.w3.org/TR/html401/struct/tables.html), so probably a vendor extension (don't think I ever used these attributes).
Re:10 Weird HTML Hacks That Shaped the Internet by fsckboy on Friday December 01, 2023 @03:05PM (#38491557)
what do you mean by "purists" wrt tables? not nesting them or something? or using them only for marking up "relational" data and not page layout? or were these purists from the design side?
Re:10 Weird HTML Hacks That Shaped the Internet by wayfinder on Saturday December 02, 2023 @01:07AM (#38496362)
Tables semantically are meant to represent tabular data and using them for layout became “wrong.”

From a practical point of view too, if you wanted to make separate mobile and desktop views just by using different stylesheets, using a table made it very difficult.

(That said, in 2000, if you were using separate mobile and screen stylesheets, you were in an extreme minority because there were relatively few full HTML web browsers on mobile devices. Instead, most phones, if they could access the Internet, accessed a different version of the Internet accessed over WAP.)

Re:10 Weird HTML Hacks That Shaped the Internet by dreamcompiler on Friday December 01, 2023 @07:48PM (#38494645)
Every time I need tabular layout I try the tool du jour: Floats, CSS grid, etc.

It never works like I want it to, and I never know if it's because I'm dumb or the tool is poorly-designed, and by then I've wasted two hours, so I always end up just going back to tables because they freaking work.

Re:10 Weird HTML Hacks That Shaped the Internet by bazoom42 on Saturday December 02, 2023 @01:06PM (#38500520)
Tables just works - as long as you know when and how to use the 1x1 transparent spacer gif.
Re:10 Weird HTML Hacks That Shaped the Internet by ifwinterco on Friday December 01, 2023 @08:07PM (#38494756)
Yep replacing tables with floats is just swapping one hack for another, with its own set of edge cases, browser incompatability etc.

The good news is now flexbox and grid work in all modern browsers, so this is (finally) a solved problem

Re:10 Weird HTML Hacks That Shaped the Internet by wayfinder on Saturday December 02, 2023 @01:01AM (#38496333)
Floats were ugly but once you did enough of them, you could nail it every time. It shouldn’t have taken months if you had an experienced team.

The only issue with floats was that there were a lot of edge cases that happened in only certain browsers, so you had to be careful. Lots of browser bugs.

Job security.

Re:10 Weird HTML Hacks That Shaped the Internet by hiccuphippo on Friday December 01, 2023 @11:37AM (#38488711)
I still remember article after article coming out with the newest "holy grail" of 3 column layout.
Re:10 Weird HTML Hacks That Shaped the Internet by jancsika on Friday December 01, 2023 @01:34PM (#38490435)
Something related to this:

I made an SVG interface for displaying/editing diagrams using nw.js (essentially Electron). It would adapt the SVG viewport height and width based on the amount of space that's actively being used so that scrollbars will appear only when needed.

The interface would work perfectly in Chromium and Firefox. But in nw.js I was using their menu api to display a window menu. That menu wasn't part of the DOM-- not sure how nw.js displays that menu but you can't introspect it in devTools. Anyhow, this was somehow creating an off-by-one problem where scrollbars would one pixel too early.

The only way I stumbled upon to fix the issue was to set the SVG style to add "float: left;"

Any ideas on what magic spell this casts? Technically the svg was the only DOM element in the page. I never did figure it out.

Re:10 Weird HTML Hacks That Shaped the Internet by robertc on Friday December 01, 2023 @03:20PM (#38491777)
Possibly the svg element was inline, so sitting on the text baseline rather than the limits of the container element?
Re:10 Weird HTML Hacks That Shaped the Internet by scotty79 on Friday December 01, 2023 @04:39PM (#38492831)
I'd say that using floats to make columns and rows in layouts was way worse hack.
Re:10 Weird HTML Hacks That Shaped the Internet by rabbits_2002 on Saturday December 02, 2023 @06:13AM (#38497769)
the time after table layouts and before flex and grid really sucked. table layouts sucked too but at least they made sense lol