Hello, how to make the whole table center align?

Get help developing custom BBCodes or request one.
Post Reply
User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Hello, how to make the whole table center align?

Post by shijixuexi »

This BBCode do not work for table,

Code: Select all

[Center]{TEXT}[/Center]
Is there any way to make the whole table center align like this?
table center.png
table center.png (230.03 KiB) Viewed 7045 times
:?: :?: :?:
Last edited by Oyabun1 on Mon Aug 26, 2013 2:12 pm, edited 1 time in total.
Reason: Moved from Support
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Hello, how to make the whole table center align?

Post by Oyabun1 »

Neither center not table are standard phpBB BBCodes so you must be using custom BBCodes. A mention of the code for each would probably help.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Re: Hello, how to make the whole table center align?

Post by shijixuexi »

Oyabun1 wrote:Neither center not table are standard phpBB BBCodes so you must be using custom BBCodes. A mention of the code for each would probably help.
Oh yes, I use a lot of custom BBCodes,

Tables from viewtopic.php?f=46&t=1151165&p=13161021#p13161021

Code: Select all

[table]{TEXT}[/table]

Code: Select all

<table border="1"><!--{TEXT}--></table>

Code: Select all

[tr]{TEXT}[/tr]

Code: Select all

--><tr>{TEXT}</tr><!--

Code: Select all

[td]{TEXT}[/td]

Code: Select all

<td style="padding: 0 10px;">{TEXT}</td>
Center from https://www.phpbb.com/kb/article/adding ... -in-phpbb3

Code: Select all

[center]{TEXT}[/center]

Code: Select all

<div style="text-align: center;">{TEXT}</div>
Center BBCodes work on text and image, but not on table. :?
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese
User avatar
Lumpy Burgertushie
Registered User
Posts: 68007
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Hello, how to make the whole table center align?

Post by Lumpy Burgertushie »

haven't tested this but try;

Code: Select all

[center][table][tr][td]your stuff[/td][/tr][/table][/center]
also, put all of it in one long line. do not use line breaks/return key.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Re: Hello, how to make the whole table center align?

Post by shijixuexi »

Lumpy Burgertushie wrote:haven't tested this but try;

Code: Select all

[center][table][tr][td]your stuff[/td][/tr][/table][/center]
also, put all of it in one long line. do not use line breaks/return key.


robert
Hello, I tested it, and find the text was center in the table, but the whole table not.
text is center in the table.png
text is center in the table.png (18.26 KiB) Viewed 6631 times
More ideas? :)
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: Hello, how to make the whole table center align?

Post by Peter77sx »

Try adding align="center" inside the <table


So something like this
<table border="1" align="center"><!--{TEXT}--></table>
User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Re: Hello, how to make the whole table center align?

Post by shijixuexi »

Peter77sx wrote:Try adding align="center" inside the <table


So something like this
<table border="1" align="center"><!--{TEXT}--></table>
Still the same for me, :cry:
align center.png
align center.png (16.52 KiB) Viewed 6517 times
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: Hello, how to make the whole table center align?

Post by Peter77sx »

How about... in a div?
<div style="text-align:center">

<div style="text-align:center"><table border="1"><!--{TEXT}--></div>

And so you wont need the [center] bbcode.
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21330
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Hello, how to make the whole table center align?

Post by RMcGirr83 »

or try

Code: Select all

<div style="margin:0px auto;">{TEXT}</div>
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Re: Hello, how to make the whole table center align?

Post by shijixuexi »

Hello Peter77sx & RMcGirr83,

I tried

Code: Select all

<div style="text-align:center"><table border="1"><!--{TEXT}--></div>

Code: Select all

<div style="text-align:center"><table border="1"><!--{TEXT}--></table></div>
And

Code: Select all

<div style="margin:0px auto;">{TEXT}</div>

Code: Select all

<div style="margin:0px auto;"><table border="1">{TEXT}</table></div>

Code: Select all

<div style="margin:0px auto;"><table border="1"><!--{TEXT}--></table></div>
All not work for my forum, so it may be just my forum's problem. Does the center BBcodes work for table on your forum?
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21330
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Hello, how to make the whole table center align?

Post by RMcGirr83 »

Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Re: Hello, how to make the whole table center align?

Post by shijixuexi »

Oh, my god! Little change, and works now!!

Code: Select all

<table style="margin:0px auto;" border="1"><!--{TEXT}--></table>
Thank you all very very very much~ :D
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese
Post Reply

Return to “Custom BBCode Development and Requests”