How to align table view all in center and in the middle of the cell?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Vasil Vasilev
Posts: 1
Joined: 2017-08-26 15:39

How to align table view all in center and in the middle of the cell?

Post by Vasil Vasilev » 2018-01-10 22:11

Hi,
I would like to align table view in the center and in the middle of the cell. I want also to do it with the header (it is always stuck on the left). I read that I can only do it with jquery. Can someone explain to me how to do it. The best way to understand it is with example. I have very basic knowledge of programming so I would ask, the explanation to be more detailed.

Thanks in advance!

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to align table view all in center and in the middle of the cell?

Post by R Tammam » 2018-01-22 09:25

Hello Vasil Vasilev,

yes you can use Jquery and it's code is so simple
1- create a table and name it tablename-tv,js
and insert the following code in it

j(function(){

$j(' tr th').css("text-align","center");
$j(' tr td').css("text-align","center");
})

it works with me

Hope it would help you :)

Regards ,
Reham

xbox2007
Posts: 26
Joined: 2016-12-16 16:49

Re: How to align table view all in center and in the middle of the cell?

Post by xbox2007 » 2018-02-12 08:42

hello
thanks for your code ,

BUT
i try this code , its not working with table view , its work only with table details ???

any support ??

xbox2007
Posts: 26
Joined: 2016-12-16 16:49

Re: How to align table view all in center and in the middle of the cell?

Post by xbox2007 » 2018-02-12 09:25

hello

i add this code in (( footer-extras.php ))

and work with me very fine , ,,,,

thanks a lot

Code: Select all

<style>

.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: top;
  border-top: 1px solid #ddd;
  text-align: center; 
  vertical-align: middle;
}



  
</style>


R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: How to align table view all in center and in the middle of the cell?

Post by R Tammam » 2018-02-28 05:34

Sorry for the late reply , and happy to see your code working <3

Post Reply