Align caption text to center of table

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Moh Youba
Veteran Member
Posts: 40
Joined: 2017-03-12 09:31

Align caption text to center of table

Post by Moh Youba » 2019-07-07 10:37

Hello

In AppGini, we can align text by choosing the desired alignment, but only text on the table can be center. I want to center the caption text.

My English is not very good to explain what I need, please see attached picture to help.

Best regards,
center_caption_fields.jpg
center_caption_fields.jpg (65.9 KiB) Viewed 145 times

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 525
Joined: 2018-04-01 10:12

Re: Align caption text to center of table

Post by pböttcher » 2019-07-07 13:18

Hi,
you can use

Code: Select all

$j("thead tr th").each(function() { $j(this).addClass("text-center") })
to set the header to center.

This applies to all table header, so if you have multiple you may need to select the one you want to control.

Moh Youba
Veteran Member
Posts: 40
Joined: 2017-03-12 09:31

Re: Align caption text to center of table

Post by Moh Youba » 2019-07-07 14:05

Hello

Thank you. Yes I want to apply to all tables.
Please, where to put this code

Thank you

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 525
Joined: 2018-04-01 10:12

Re: Align caption text to center of table

Post by pböttcher » 2019-07-07 15:21

Hi,

put it in hooks/footer-extras.php

Code: Select all

<script>
$j("thead tr th").each(function() { $j(this).addClass("text-center") })
</script>

Moh Youba
Veteran Member
Posts: 40
Joined: 2017-03-12 09:31

Re: Align caption text to center of table

Post by Moh Youba » 2019-07-07 15:29

humm !!! I put in the hooks/footer-extars.php but still align in left
hooks-1.jpg
hooks-1.jpg (13.11 KiB) Viewed 130 times
hooks-2.jpg
hooks-2.jpg (41.93 KiB) Viewed 130 times

Moh Youba
Veteran Member
Posts: 40
Joined: 2017-03-12 09:31

Re: Align caption text to center of table

Post by Moh Youba » 2019-07-07 15:32

ok working fine.
first I put inside <?php ... ?>
now I put oustise and it is working fine
thank you for your great help and support

You give me also opportunity to learn new thing

best regards,

Post Reply