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,
Align caption text to center of table
Re: Align caption text to center of table
Hi,
you can use
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.
you can use
Code: Select all
$j("thead tr th").each(function() { $j(this).addClass("text-center") })
This applies to all table header, so if you have multiple you may need to select the one you want to control.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Align caption text to center of table
Hello
Thank you. Yes I want to apply to all tables.
Please, where to put this code
Thank you
Thank you. Yes I want to apply to all tables.
Please, where to put this code
Thank you
Re: Align caption text to center of table
Hi,
put it in hooks/footer-extras.php
put it in hooks/footer-extras.php
Code: Select all
<script>
$j("thead tr th").each(function() { $j(this).addClass("text-center") })
</script>
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Align caption text to center of table
humm !!! I put in the hooks/footer-extars.php but still align in left
Re: Align caption text to center of table
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,
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,
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Re: Align caption text to center of table
Thanks Pascal, good to know! Is there a way to point this out to specific table?
Re: Align caption text to center of table
Try putting Pascal's code in hooks/TABLENAME-tv.js
(please note that it is ...-tv.js not ...-dv.js)
if you hate the header text wrapping, you can also add nowrap class like the following
please note that your entire table width may be looooooooger...
Good luck and stay safe.
(please note that it is ...-tv.js not ...-dv.js)
Code: Select all
// To make table heading center
$j(function () {
$j("thead tr th").each(function () {
$j(this).addClass("text-center");
});
});
Code: Select all
// To make table heading center and no wrapping
$j(function () {
$j("thead tr th").each(function () {
$j(this).addClass("text-center text-nowrap");
});
});
Good luck and stay safe.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Re: Align caption text to center of table
Thanks Zala! I'll try later on and let you know. Appreciate your input!
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Re: Align caption text to center of table
Hi Zala, I have created new my_table_name-tv.js in hooks folder and dropped your code in there, but it doesn't seem to be doing anything Thanks for your help Buddy.
Re: Align caption text to center of table
Hmmm...It is working for me....how strange.....
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
Re: Align caption text to center of table
Although it is working, but after this I cant hide any column anymore, all column maintain showing.zibrahim wrote: ↑2020-11-17 01:41Try putting Pascal's code in hooks/TABLENAME-tv.js
(please note that it is ...-tv.js not ...-dv.js)if you hate the header text wrapping, you can also add nowrap class like the followingCode: Select all
// To make table heading center $j(function () { $j("thead tr th").each(function () { $j(this).addClass("text-center"); }); });
please note that your entire table width may be looooooooger...Code: Select all
// To make table heading center and no wrapping $j(function () { $j("thead tr th").each(function () { $j(this).addClass("text-center text-nowrap"); }); });
Good luck and stay safe.