History: Making columns for wiki content
Source of version: 20
Copy to clipboard
! Introduction In days gone by, HTML tables were used to lay out web page content, but with the invention of cascading style sheets, divs have replaced tables as the preferred containers of content on a web page. To encourage Tiki site authors to use up-to-date layout methods, here is some syntax that enables easy layout of two, three, or four columns on a wiki page. Of course Tiki's wiki syntax for tables can still be used where it's appropriate: for tabular data. ''wiki syntax:'' ||::__Cool Web layout method__:: 1990s | HTML tables Today | CSS (divs, etc.) || ''FANCYTABLE'' plugin: {FANCYTABLE(head="Column 1 | Column 2")}Row 1 Column 1 | Row 1 Column 2 Row 2 Column 1 | Row 2 Column 2 Row 3 Column 1 | Row 3 Column 2{FANCYTABLE} But for correct semantic layout of general page content, tables aren't appropriate and should be avoided, which is where this floated box method works well. ! Also for L&F custom code Site admins, these same CSS classes can be used in Look and Feel custom code areas - site header, top bar, center column heading, and bottom bar - if you want to have two or more columns of content in any of those areas. ! Procedure Each place where columns are wanted, add a div with the appropriate class -- ''halffloat'', ''thirdfloat'', or ''quarterfloat'', depending on if there are to be two, three, or four columns, and the class ''clearfix''. Clearfix ensures that the background or border will go down around all the floated divs, and that the content of this div won't overlap or be overlapped by the content below it. If a div is used instead of a module within the halffloat, etc. it needs to have the class ''box''. See example below. Combinations of non-module divs and modules are also ok. ! Examples !! Two columns {DIV(class="halffloat clearfix")} {MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{DIV} is produced by: {CODE(wrap="1")}{DIV(class="halffloat clearfix")} {MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{DIV}{CODE} !! Three columns {DIV(class="thirdfloat clearfix")} {MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{DIV} produced by {CODE(wrap="1")}{DIV(class="thirdfloat clearfix")} {MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{DIV}{CODE} and !! Four columns {DIV(class="quarterfloat clearfix")}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{DIV} produced by {CODE(wrap="1")}{DIV(class="quarterfloat clearfix")}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{MODULE(module=random_pages)/}{DIV}{CODE} Boxes can have any content, not just a module, like this (''Sorry but this part of the demo is temporarily out of order in Tiki 4.0. It is fixed in the code for TIki 4.1. In the meantime, for the non-module columns to display side by side, their div class="box" must have a 'style=float:left !important" rule added inline.'') : {DIV(class="halffloat clearfix")}{DIV(class="box")}Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken. Het heeft niet alleen vijf eeuwen overleefd maar is ook, vrijwel onveranderd, overgenomen in elektronische letterzetting. Het is in de jaren '60 populair geworden met de introductie van Letraset vellen met Lorem Ipsum passages en meer recentelijk door desktop publishing software zoals Aldus PageMaker die versies van Lorem Ipsum bevatten.{DIV}{DIV(class="box")}Lorem Ipsum é um texto modelo da indústria tipográfica e de impressão. O Lorem Ipsum tem vindo a ser o texto padrão usado por estas indústrias desde o ano de 1500, quando uma misturou os caracteres de um texto para criar um espécime de livro. Este texto não só sobreviveu 5 séculos, mas também o salto para a tipografia electrónica, mantendo-se essencialmente inalterada. Foi popularizada nos anos 60 com a disponibilização das folhas de Letraset, que continham passagens com Lorem Ipsum, e mais recentemente com os programas de publicação como o Aldus PageMaker que incluem versões do Lorem Ipsum.{DIV}{DIV} produced by: {CODE(wrap="1")}{DIV(class="halffloat clearfix")}{DIV(class="box")}Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. . . .{DIV}{DIV(class="box")}Lorem Ipsum é um texto modelo da indústria tipográfica e de impressão. O Lorem Ipsum tem vindo a ser o texto padrão usado por estas indústrias desde o ano de 1500. . . .{DIV}{DIV}{CODE} !! Mix of modules and other divs {DIV(class="halffloat clearfix")}{DIV(class="box")} !! Lorem Ipsum Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken.{DIV} {MODULE(module=random_pages)/}{DIV} produced by {CODE(wrap="1")}{DIV(class="halffloat clearfix")}{DIV(class="box")}!!Lorem Ipsum Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken.{DIV} {MODULE(module=random_pages)/}{DIV}{CODE}