Advanced BB-coding
You've read about the basic BB-coding, learned it, and now know how to use it pretty well. Neat, can't wait to see what amazing guides you create with it. However, sometimes you may feel like something's missing. That... "perfect" BB-coding. The more advanced stuff! And thus I,
xZero_Strike - guide writer on
SMITEfire, hereby present you: the advanced BB-coding section of the guide!
Note: This coding is the real deal. They're somewhat confusing to understand for newer members, and some of these are
very sensitive (e.g.: Tables). Only proceed if you've mastered the basics, or be prepared to, sadly, waste a lot of time trying to figure out what you did wrong when that one table comes out all messed up.
Advanced code, code, code...
The advanced code concludes many things. The most common example would be columns. Tables also come to mind, and much more. Since these codes are usually a bit more elaborate, each code will get its own spot, for your ease.
Columns
Columns is a tool that allows you to place text in a designated spot across the horizontal line of the writing board. It's a bit similar to how [left], [center] and [right] would work, except here you have much more control over where the text will actually be placed, and you can place them anywhere across the horizontal line of the writing board, not just centered or outlined.
Example:
|
|
|
|
|
|
|
|
|
| |
This column
is 340
pixels wide.
|
|
|
|
|
|
|
|
|
| |
This one is 220 pixels wide. |
|
|
|
|
|
|
|
|
| |
This one is 100 pixels wide.
|
|
|
|
|
|
|
|
|
|
|
The code: (Without outlining (|'s))
Code:
[columns]
[nextcol width=340][left]This column[/left]
[center]is 340[/center]
[right]pixels wide.[/right]
[nextcol width=220]This one is 220 pixels wide.
[nextcol width=100][center]This one is 100 pixels wide.[/center]
[/columns]
Explaining the code
Columns are handy dandy. Open columns using the [columns] tag, and close it using [/columns]. For every new columns you want to add, use [nextcol width=x], where x is the amount of pixels that the column has to be wide. You can simply start a new column with [nextcol]. Do note that the writing board is 680 pixels wide, so if you want to have text in a special position, e.g. 1/4th of the writing board, you'll need to plan your column widths accordingly.
Code with outlining (|'s)
Note: Outlining isn't added automatically with columns. If you want to have an outlining, you'll have to use tables, or add them manually.
[columns]
[nextcol width=1]|
|
|
|
|
|
|
|
|
[nextcol width=340][left]This column[/left]
[center]is 340[/center]
[right]pixels wide.[/right]
[nextcol width=1]|
|
|
|
|
|
|
|
|
[nextcol width=220]This one is 220 pixels wide.
[nextcol width=1]|
|
|
|
|
|
|
|
|
[nextcol width=100][center]This one is 100 pixels wide.[/center]
[nextcol width=1]|
|
|
|
|
|
|
|
|[/columns]
Spoiler
You can argue that spoilers aren't "advanced", but oh boy if you forget to close one of these! Spoilers are often used to hide away big chunks of information, mainly to conserve space. They're also used to hide away more unnecessary information, such as a God's lore, so that those who aren't interested in it, don't need to read it.
Example:
Spoiler: Click to view
This is an unnamed spoiler. Did you know that all codes work within spoilers? You can place images in here, add columns, tables, and much, much more.
I HAVE A NAME!
This is a named spoiler. It functions identical to an unnamed spoiler, but a spoiler with a name can instantly tell the reader what they can find inside a spoiler!
The code:
Unnamed
|
[spoiler]
This is an unnamed spoiler. Did you know that all codes work within spoilers? You can place images in here, add columns, tables, and much, much more.[/spoiler]
|
Named
|
[spoiler=I HAVE A NAME!]
This is a named spoiler. It functions identical to an unnamed spoiler, but a spoiler with a name can instantly tell the reader what they can find inside a spoiler![/spoiler]
|
explaining the code
To create spoilers, simply open using [spoiler] and close with [/spoiler]. To name a spoiler, simply use [spoiler=x], where x is the name of your spoiler.
Rulers
Throughout the guide, you may have noticed those lines placed here and there and everywhere. Those are rules / dividers. They're useful to divide information that cover different topics from each other.
Example:
|
|
This is one way to create a rule. |
This is another.
|
Code:
|
|
This is one way to create a rule. |
This is another.
|
Explaining the code
Rules can be made in 2 ways. Well, technically 4, but we'll get into that later. One way to create a rule is by using the [rule] command. This will create a rule that will use all of its available horizontal space. You can limit the width of a rule by restricting its width through, for example, columns. Another way to create rules is by using . Note that when using '-'s, you need at least 5 for it to take effect.
You can also use tables to make
colored rules. Using tables, you can also adjust the thickness of the rule and the width of the rule.
Example (1):
Example (2):
Code (1):
Code:
[table][tr][td padding=1 bgcolor=#00ff00 width=340][/td][/tr][/table]
Code (2):
Code:
[table][tr][td padding=5 bgcolor=#ff0000 width=680][/td][/tr][/table]
Explaining the table ruler code
To create a rule using a table, simply open a table by using
[table][tr][td]. This is our base. From here we can edit the color, width and thickness by
adding these 3 variables to the [td] tag:
- [padding=x] - This will control the thickness of the rule. Replace x with a number. The higher the number, the thicker the rule.
- [width=x] - This will control the width of the rule. Replace x with a number. The higher the number, the wider the rule.
- [bgcolor=x] - This will control the color of the rule. Replace x with a color hex code (e.g. #ffffff).
Usage: [table][tr][td padding=x bgcolor=x width=x][/td][/tr][/table]
Indents
Indents are another form of spacing. The thing that makes indents stand out from other forms of spacing is that indents will always have the same width, and thus make the spacing consistent, making for a nice, clean look. Indents can be stacked, creating even more spacing. Do note that indents need to be closed.
Example (1):
This text has no indent!
This text has one indent!
This text has two indents! We'll have to see a dentist to get this checked out!
Just one, again.
I have my own indent, but the one from the previous text carried over! Such a meany!
You need an equal amount of indent closes as you have indents! Don't forget!
Example (2):
|
This is
|
indents combined
|
with columns.
|
= Equal spacing!
|
Indents in columns don't need to be closed, since they already have an "end", due to the columns.
Code (1):
Code:
This text has no indent!
[indent]This text has one indent![/indent]
[indent][indent]This text has two indents! We'll have to see a dentist to get this checked out![/indent][/indent]
[indent]Just one, again.
[indent]I have my own indent, but the one from the previous text carried over! Such a meany![/indent][/indent]
You need an equal amount of indent closes as you have indents! Don't forget!
Code (2):
Code:
[columns][nextcol][indent]This is
[nextcol][indent]indents combined
[nextcol][indent]with columns.
[nextcol][indent]= Equal spacing![/columns]
Indents in columns don't need to be closed, since they already have an "end", due to the columns.
Explaining the code
Indent add a small amount of space wherever they're placed. While neat, do be careful with these. For every [indent], you need an [/indent], or else they'll carry over to all following text, until you end them somewhere else or they reach the end of the chapter. Indents that are closed via other methods, such as tables or columns, don't necessarily require a [/indent].
Anchor / Goto [ Tags ]
At the bottom of every chapter, you may have noticed those clickable words. These are "tags". Not many know about this, as it's not explained by many sources. Tags aren't made with a single command/code, however. To make tags, we'll need to learn and use 2 different codes.
|
#1 - Anchor | Example:
# <- There's an anchor here.
#1 - Anchor | Code:
Code:
[anchor=Name] <- There's an anchor here.
|
#2 - Goto | Example:
Click here to go to the Anchor left of me!
#2 - Goto | Code:
Code:
[goto=Name]Click here to go to the Anchor left of me![/goto]
|
Explaining the code
To create a "tag", we'll first have to create an anchor. We do so by simply using [Anchor=x], where 'x' is the name of the Anchor. Remember this name, as it's important.
Now that we have the anchor, we need to create a clickable object that will take us straight to that anchor. For this, we use the [goto] code.
Usage: [goto=x]< Text here >[/goto]
x is the name, it has to be the name of one of your anchors, specifically the anchor you want that clickable object to take you to. Replace the 'text here' with the text that you want to show up that will be clickable.
Notes
The clickable object can be modified as regular text. This means that you can color it, re-size it, etc...
Another important thing to note, is that whenever you click a "goto", it places you just underneath the anchor, instead of actually on it. This means that if you want to have an anchor take you to the start of a chapter, you'll have to place the anchor on the bottom of the chapter above it.
Tables
Tables are by far my personal favorite way to present text. They're very customizable, give a clean and nice look, and can hold all previously mentioned BB-codes within them. The only downside is that they're fairly "unstable", as a single miss in your code will mess the table up and it'll come out completely messed up.
Example basic table:
In the 'Wavebar' apartment block, 21st of December 2016 - 11:00 PM. The 2 owners of the apartments on the upper level woke up and decided to have a noisy chat.
Hello!!!
|
.
Sup!!!
.
. |
Quiet up there, I'm trying to sleep!
|
.
Hey, you 2 should kiss!
.
. |
If you don't quiet down right now, I'm gonna call the cops!
|
.
Oh shut up, or I'm coming over there and I'll teach you to!
. |
Code basic table:
Code:
[table bgcolor=#46cf46]
[tr bgcolor=#000000][td][center]Hello!!![/center][/td][td][center][color=Transparent].[/color]
Sup!!![/center]
[color=Transparent].[/color]
[color=Transparent].[/color][/td][/tr]
[tr bgcolor=#000000][td][center]Quiet up there, I'm trying to sleep![/center][/td][td][color=Transparent].[/color]
[center]Hey, you 2 should kiss![/center]
[color=Transparent].[/color]
[color=Transparent].[/color][/td][/tr]
[tr bgcolor=#000000][td][center]If you don't quiet down right now, I'm gonna call the cops![/center][/td][td][center][color=Transparent].[/color]
Oh shut up, or I'm coming over there and I'll teach you to![/center]
[color=Transparent].[/color][/td][/tr][/table]
Explaining the code - Basic table
As mentioned before, tables are highly customizable. The table above is a one of the most basic tables. They have a colored outline and a colored background. To create a table, we'll need 3 pieces of codes. These codes being
[table], [tr] and [td].
- [Table] - This code is used to open/start a table. It can be customized in terms of color (outline), style and width. More on that later.
- [tr] - This code is used to start a new row inside of a table. A row can contain multiple cells. A row is customizable in color (background).
- [td] - This code is used to start a new cell within a row. The cell is the area your text will appear in. Cells can be customized in width and padding (distance 'text <-> border').
Example advanced (customized) table (1):
"I am super pretty, am I not? I bought this dress in that new shop "tabledressers", and I totally luuuuuv it! Hey fam, you should totally check it out right now, like Oh my Gooood, it's so fabulouuuus!" |
Example advanced (customized) table (2):
Heeeeelloooooo cray peeps!
|
Yolo Swagginson here!
|
I got chu nooow!
|
WHAT? NOOO! Guys, he has me, this is... *Cough* the end of our advanced BB-coding... Send help, plox!
|
exact code (Really exact, to be honest, it's just ctrl+c/v, really)
Code advanced (customized) table (1):
Code:
[table border="7px dotted #46cf46" border-radius="15px"]
[tr bgcolor=#000000][td padding=10]"I am super pretty, am I not? I bought this dress in that new shop "tabledressers", and I totally luuuuuv it! Hey fam, you should totally check it out right now, like Oh my Gooood, it's so fabulouuuus!"[/td][/Tr][/table]
Code advanced (customized) table (2):
Code:
[table border="3px dashed #3cb371" border-radius="5px"]
[tr bgcolor=#000000][td border="3px solid #46cf46" border-radius="5px" padding=10][center]Heeeeelloooooo cray peeps![/center][/Td][td border="3px double #46cf46" border-radius="5px" padding=5][center]Yolo Swagginson here![/center][/td][/tr]
[tr bgcolor=#000000][td border="3px inset #46cf46" border-radius="5px" padding=15][center]I got chu nooow![/center][/Td][td border="3px groove #46cf46" border-radius="5px" padding=20][center]WHAT? NOOO! Guys, he has me, this is... *Cough* the end of our advanced BB-coding... Send help, plox![/center][/td][/tr][/table]
Explaining the variables
Those "advanced" tables are actually just tables. Weird, huh? Bet you were thinking it was some alien voodoo space magic. It's not. You create those tables by adding variables to the previously mentioned table codes. Let's have a look at the possible variables.
- Variables (works for [Table], [tr] and [td] individually)
- bgcolor=x - Add color to the border of your table. This affects the outer as well as the inner borders, unless overridden by cell-specific border coloring, in which it only affects the outer border.
Usage: [table bgcolor=x], replace x with color hex code (#ffffff).
Note: "bg" stands for background. If used in row or cell, it changes the backgrounds of this row or cell. You may wonder, if it means background, why does it only affect the borders if used in [table]? Here's the thing: it actually changes the table background. However, your cell ([td]) backgrounds cover over the table background. You can see this effect if you make a table with only bgcolor as its parameters and no rows or cells in it.
- border="x y z" - Allows you to adjust the thickness or the border, the style and the color. Can work on the entire table, a single row or a single cell.
Usage: [table border="x y z"], replace x with the border thickness (e.g. "5px"), replace y with the border style (e.g. "dotted"), replace z with the border color hex code (e.g. "#ffffff").
List of possible styles:
- Solid
- Dotted
- Double
- groove
- inset
- ridge
- dashed
- border-radius="x" - Allows you to set the curve of the border. The curve means the rounded corners, a.k.a how "rounded" they'll be. Can work on the entire table, a single row or a single cell.
Usage: [table border-radius="x"], replace x width the desired rounding amount (e.g. "5px").
Note: All these variables work for the [table], [tr] and [td] tags individually. This means that you can give each row/cell a different background color, for example, or different styles of borders and border colors, etc... The possibilities are endless!
Table comparison
Border
Table with Border of 5px
Table with border of 20px
Border-radius
Table with Border-radius of 5px
Table with Border-radius of 20px
Padding
Table with a padding of 5
Table with a padding of 50
Extra: 'colspan=x' and 'rowspan=x'
Colspan=x is a variable that can be added to the [td] tag of tables. It allows one cell to span over the same width of multiple cells from another row.
To explain it differently:
If you create a row with only 1 cell in it, that single cell will take the same width as the table. However, if you place a row with 2 or more cells above or beneath it, the cell from the single row will only span over the width of 1 cell, which will cause a "gap" in your table.
Note: The colspan=x tag has to be added to the cell ([td]) that needs to increase in length. In simple: the single cell in the row that has to become as wide as the 2(+) cells above or beneath it. If that makes sense.
Note: replace the 'x' in colspan=x with the amount of cells that one cell has to span over.
Example
Table without colspan
Hi! |
Hello! How's it going? |
Good, thanks, you? |
Code:
[table bgcolor=#46cf46][tr bgcolor=#000000][td padding=5]Hi![/td][/tr]
[tr bgcolor=#191919][td padding=5]Hello! How's it going?[/td][td padding=5]Good, thanks, you?[/td][/tr][/table]
Table with colspan
Hi! |
Hello! How's it going? |
Good, thanks, you? |
Code:
[table bgcolor=#46cf46][tr bgcolor=#000000][td padding=5 colspan=2]Hi![/td][/tr]
[tr bgcolor=#191919][td padding=5]Hello! How's it going?[/td][td padding=5]Good, thanks, you?[/td][/tr][/table]
Rowspan=x, just like colspan, spans a table cell over multiple other cells, except instead of spanning over columns, it spans over rows.
This means that, should you make a 2 by 2 table, or 2 columns & 2 rows, without rowspans, you would have 4 individual cells. with rowspan, we can have one column have 1 cell that spans across the height of the 2 cells of the adjacent column. If we were to try to achieve the same result without rowspan, we would have, just as with colspan for columns, a gap in our table.
Note: since rowspan is a tag that has a near identical effect to colspan, it goes without saying that this should be placed in the same location as colspan would, namely in the [td] tag in our table constructor code.
Replace the 'x' with the number of rows a cell needs to span over
An example
Example:
A cell with rowspan.
|
Cell in the same row as the cell with rowspan.
|
Cell in a second row, but still adjacent to the rowspan cell from a different row, thanks to rowspan.
|
Code:
Code:
[table bgcolor=#46cf46 width=660]
[tr bgcolor=#000000]
[td rowspan=2 padding=5][center]A cell with rowspan.[/center][/td]
[td padding=5][center]Cell in the same row as the cell with rowspan.[/center][/td]
[/tr]
[tr bgcolor=#000000]
[td padding=5][center]Cell in a second row, but still adjacent to the rowspan cell from a different row, thanks to rowspan. Note that there is only 1 cell in this row, even though we have 2 columns. That is because the cell from the previous row covers the first cell already thanks to rowspan.[/center][/td]
[/tr]
[/table]
Additionally, for the fans,
it is possible to combine both colspan and rowspan together to create a cell that spans over multiple rows as well as columns. Simply add both parameters together to generate the desired result (
[td rowspan=x colspan=x])
An example
Example:
Cell with both colspan and rowspan. This one will span across 2 rows as well as 2 columns.
|
A cell from the first row. Note that we have 3 columns, technically, though we only have 2 cells. This is because the previous cell spans 2 columns, thanks to colspan.
|
A simple, lonely cell in row 2. Only 1 cell is needed here, because the previous 2 columns are already occupied by the cell from the previous row because of rowspan, which also covers 2 columns (2 cells) because of colspan.
|
The last row is an unaffected row, its sole purpose is to show the colspan + rowspan effect clearly.
|
Though the cell above spans 2 columns because of colspan.
|
Cereal first, then the milk.
|
Code:
Code:
[table bgcolor=#46cf46 width=660]
[tr bgcolor=#000000]
[td rowspan=2 colspan=2 padding=5][center]Cell with both colspan and rowspan. This one will span across 2 rows as well as 2 columns.[/center][/td]
[td padding=5][center]A cell from the first row. Note that we have 3 columns, technically, though we only have 2 cells. This is because the previous cell spans 2 columns, thanks to colspan.[/center][/td]
[/tr]
[tr bgcolor=#000000]
[td][center]A simple, lonely cell in row 2. Only 1 cell is needed here, because the previous 2 columns are already occupied by the cell from the previous row because of rowspan, which also covers 2 columns (2 cells) because of colspan.[/center][/td]
[/tr]
[tr bgcolor=#000000]
[td][center]The last row is an unaffected row, its sole purpose is to show the colspan + rowspan effect clearly.[/center][/td]
[td][center]Though the cell above spans 2 columns because of colspan.[/center][/td]
[td][center]Cereal first, then the milk.[/center][/td]
[/tr]
[/table]
NOTE: It is highly important that, when using colspan and rowspan, that you respect your overall column or row count, otherwise your table will be messed up!
What this means, simplified:
If you have a cell that spans 2 columns, in a table of 3 columns, you should ONLY add 1 additional cell to that row, since the previous one spans the previous 2. 2+1 = 3.
The same counts for rows. If you have a cell that spans 2 rows in a table with 2 columns, the row below it should only have 1 cell, as the cell from the row above will span over and occupy the first column in the new row already. 1+1=2.
If you combine rowspan AND colspan, be sure to do the math before you start coding. The best advice I can give you is to draw or imagine the table you wish to have, and see how many cells you'll need based on that.
Whoo-wee. This did not age well! Which is to say, some bb-code seems to no longer be functional. The main ones I can see are [columns] and [center], but there may be more! I'll update this guide as quickly as I can to make everything look right, and a mobile version will be in the works as well as soon as this one's back in shape.
If your guide uses BB-coding (hint: it should), it's advised you have a look-over to make sure everything looks right.
They fixed columns! Yay!
I remember that I already used this guide a long time ago :p
Some minor visual changes and error fixes.
Full changelog found at the bottom of the guide.
Ah it's no worries, but I appreciate it nonetheless. <3
This guide saved my life with my stopped Tyr Guide, thank you man!!!
Here's the code:
CODE:
you can start by adding me to the creditsHey man im happy to help! I'll report anything, major or minor to you.
Psht..., how dare you even ask?!Totally, thanks a ton man. Little details like these can add or take away from the reading experience!
Yeah I put you in the credits, lol.
Under P&C TEMPLATE #1 (GENERIC), I think your code is missing a [/columns] at the very end.
I think this should be the corrected CODE:
An example of your code without the correction:
<Pro here>
<Pro here>
<Pro here>
<Con here>
<Con here>
<Con here>
<Random Text is out of place due to error in the code>
<Random Text is out of place due to error in the code>
<Pro here>
<Pro here>
<Pro here>
<Con here>
<Con here>
<Con here>
<Test 1 2>
<Test 1 2>
<BranMuffin is OP, pls nerf>
If you find any more mistakes or missing tags, please let me know.
Thank you.
Due to an unknown change this coding had some problems with placement / outlining, specifically with the icons at the top row.
I've thus fixed this issue as soon as I noticed it. To anyone who used this template, it may be worth checking your guides and see if everything's OK or not.
To fix this issue, you can either:
For more information regarding this issue and when it was fixed, check the below changelog:
My best guess is a change in the coding of the site that we don't know of. The impact isn't too severe from what I've encountered so far but users may want to reread their guides to look for issues in their coding.
I need a new phone!
And yeah, sounds like you might need a new one indeed.
Votes don't change much, at least not for me, so it doesn't really bother me.