News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

New to theming: why tables?

Started by mabley, May 01, 2017, 03:35:30 PM

Previous topic - Next topic

mabley

I'm an experienced front-end developer, and I've wanted to try my hand at a custom SMF theme. Perhaps this is obvious, but why do I see so many HTML tables in the SMF mark-up?

Is the structure of a forum index one that is suited to the semantics of HTML Tables, or?


Arantor

Because in 2007 when 2.0's theme was first designed, semantic markup didn't really exist as a concept and to get the pixel perfect layout in IE6 basically required it be this.

And of course, 2.0's theme was built on top of the theme from 2004 which basically required tables to retain IE4 and 5 compatibility.

mabley

Thank you - that makes total sense.

Do we think it'd be cool if I reconsidered tables when creating a new theme from scratch? At this point, I'm making a theme largely to just try making a theme.

Arantor

The only problem with changing themes like that is that you need to change basically every single template including the administrative and helper templates - and if you plan to release it this means a nightmare for support...

Antechinus

Quote from: mabley on May 02, 2017, 01:28:46 PM
Thank you - that makes total sense.

Do we think it'd be cool if I reconsidered tables when creating a new theme from scratch? At this point, I'm making a theme largely to just try making a theme.

Go for it. It's what happened for 2.1 anyway. Just take heed of Arantor's warning, but you probably realised you'd be making more work for yourself.

feline

It's a big work to replace all the tables width a lot of divs .. also you have to note, that divs not give the same result as a table.
If you do that with divs, you need mostly the construct:

<div style="display:table; table-layout:fixed">
   <div style="display:table-row">
      <div style="display:table-column">content </div>
         ... more cols ...
      </div>
   </div>
        ... more rows/cols
</div>

So this is better as a simple table .. tr .. td ?

I think .. no, never  ;)

Antechinus

Well, sometimes. When the content really is tabular. ;) Which the board index definitely isn't.

Advertisement: