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!
How to align table view all in center and in the middle of the cell?
-
- Posts: 6
- Joined: 2017-08-26 15:39
Re: How to align table view all in center and in the middle of the cell?
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
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
Re: How to align table view all in center and in the middle of the cell?
hello
thanks for your code ,
BUT
i try this code , its not working with table view , its work only with table details ???
any support ??
thanks for your code ,
BUT
i try this code , its not working with table view , its work only with table details ???
any support ??
Re: How to align table view all in center and in the middle of the cell?
hello
i add this code in (( footer-extras.php ))
and work with me very fine , ,,,,
thanks a lot
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>
Re: How to align table view all in center and in the middle of the cell?
Sorry for the late reply , and happy to see your code working <3