MyBB Codes

Full Version: Custom Tables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been searching for a plugin that would allow me to create custom tables with my own data. Some features I'm looking for include:
  • A search function
  • Option to show certain number of rows on one page
  • Different colored rows
  • Supports HTML
This could be achieved with simple MyCodes, here is an example for a 2 columns table :
PHP Code:[Highlight]
\[table=(.*?)\](.*?)\[/table\]

<
table style="border: 1px solid; border-collapse:collapse;" width="90%" align="center"><tr><th colspan=2 align="center">$1</th></tr>$2</table

PHP Code:[Highlight]
\[row=(.*?),(.*?)\](.*?),(.*?)\[/row\]

<
tr style="vertical-align: top">
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$1</div>$3</td>
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$2</div>$4</td>
<
tr

Then in your post you only have to write :
PHP Code:[Highlight]
[table=table header]
[
row=left sub-header,right sub-header]left content,right content[/row]
[
row=left sub-header,right sub-header]left content,right content[/row]
[
row=left sub-header,right sub-header]left content,right content[/row]
[
row=left sub-header,right sub-header]left content,right content[/row]
[/
table

You can use 2 different row Mycodes for odd/even row colors or add a fifth parameter for the color. Wink
(08-06-2011 04:54 PM)exdiogene Wrote: [ -> ]This could be achieved with simple MyCodes, here is an example for a 2 columns table :
PHP Code:[Highlight]
\[table=(.*?)\](.*?)\[/table\]

<
table style="border: 1px solid; border-collapse:collapse;" width="90%" align="center"><tr><th colspan=2 align="center">$1</th></tr>$2</table

PHP Code:[Highlight]
\[row=(.*?),(.*?)\](.*?),(.*?)\[/row\]

<
tr style="vertical-align: top">
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$1</div>$3</td>
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$2</div>$4</td>
<
tr

Then in your post you only have to write :
PHP Code:[Highlight]
[table=table header]
[
row=left sub-header,right sub-header]left content,right content[/row]
[
row=left sub-header,right sub-header]left content,right content[/row]
[
row=left sub-header,right sub-header]left content,right content[/row]
[
row=left sub-header,right sub-header]left content,right content[/row]
[/
table

You can use 2 different row Mycodes for odd/even row colors or add a fifth parameter for the color. Wink

But would I be able to specify how many rows I want to show on one page? This information will be displayed on a single php page - not a post. Is a search field also possible? I thought a MYSQL database had to be used to retrieve this information.

A very similar table was designed for Wordpress under the name "WP-Tables Reloaded".
When you do a search, all posts are searched!

This seemed to be the easiest way to achieve what you need, if you have more specific needs you would have to tell me.

If you need a multi-page system for a specific display of content, this would be a personal plugin and would need to be done only for you. I hope you understand that this would need to be charged separately... Wink

Send me a PM with the specifics if you want a quote...
(08-06-2011 06:06 PM)exdiogene Wrote: [ -> ]When you do a search, all posts are searched!

This seemed to be the easiest way to achieve what you need, if you have more specific needs you would have to tell me.

If you need a multi-page system for a specific display of content, this would be a personal plugin and would need to be done only for you. I hope you understand that this would need to be charged separately... Wink

Send me a PM with the specifics if you want a quote...

PM sent! Shy
Hi
how can I do for three row please
3 columns table
You will simply need to expand your row MyCode like this :
PHP Code:[Highlight]
\[row=(.*?),(.*?),(.*?)\](.*?),(.*?),(.*?)\[/row\]

<
tr style="vertical-align: top">
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$1</div>$4</td>
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$2</div>$5</td>
<
td style="border: 1px solid #000;" align="center"><div style="background:#c0c0c0; padding-bottom:4px; margin-bottom:8px;">$3</div>$6</td>
</
tr


And use it like this :
PHP Code:[Highlight]
[row=left sub-header,middle sub-header,right sub-header]left content,middle content,right content[/row
Thanks for my supporting
Reference URL's