MyBB Codes
Custom Tables - Printable Version

+- MyBB Codes (http://www.mybbcodes.com)
+-- Forum: Mods Database (/forumdisplay.php?fid=4)
+--- Forum: Requests (/forumdisplay.php?fid=16)
+--- Thread: Custom Tables (/showthread.php?tid=3764)


Custom Tables - tacodelivery - 08-06-2011 04:10 PM

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



RE: Custom Tables - exdiogene - 08-06-2011 04:54 PM

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


RE: Custom Tables - tacodelivery - 08-06-2011 05:00 PM

(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".


RE: Custom Tables - exdiogene - 08-06-2011 06:06 PM

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...


RE: Custom Tables - tacodelivery - 08-06-2011 06:51 PM

(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


RE: Custom Tables - Midori - 04-27-2013 04:21 PM

Hi
how can I do for three row please
3 columns table


RE: Custom Tables - exdiogene - 04-28-2013 07:42 AM

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



RE: Custom Tables - Midori - 04-29-2013 02:56 PM

Thanks for my supporting