MyBB Community Forums

Full Version: Full Table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I'm posting on how to make a FULL table with all HTML Attributes intact!

I know there is already a thread posted about tables, but this one you have 100% control of everything!

First you need to create the table code.

Simple Expression:
\[table(.*?)\](.*?)\[/table\]
HTML Replacement:
<table$1>$2</table>
The (.*?) (next to [table) Enables the use of attributes!

(note items bold below are things you can change freely)
Attributes you may use in the BBCode:
Align="Left"
Align="Right"
Align="Center"
BGColor="#FF0000"
BGColor="Red"
Background="images/smilies/tongue.gif"
Border="1px"
Class="CSSTable"
Note to Others Wrote:Class Defines what CSS or Javascript it may follow!!!
width="50px"
width="50%"

Note to Others Wrote:These attributes will also work for the codes below
_______________________________________________________


Now you need to make the table rows!

Simple Expression:
\[row(.*?)\](.*?)\[/row\]

HTML Replacement:

<tr$1>$2</tr>


_______________________________________________


Lastly, you need the table columns!
Note to Others Wrote:Table columns should be inside table rows.

AKA
[row class="ARow"][col class="AColumn"]TEXT HERE[/col][/row]


Simple Expression:
\[col(.*?)\](.*?)\[/col\]


HTML Replacement:
<td$1>$2</td>


__________________

Now your tables will work, you will need the columns and row codes!!!

Please rate out of 10, I need to know where I stand!!!
thank you for your code, but if I add a button on my editor and I want appear a popup to create a table, how to it?
It's hard to do it, because you'll need do sth with javascripts ? Do you ?

Sr, i'm just a newbie
Oh I'm newbie like you! Thank you