Tables - need to center text and images

Create a successful portfolio or freelance web design showcase website Joomla theme discussion forum.
GK User
Sat Jul 13, 2013 6:46 pm
Hi all,
After extensive research and DAYS of trying everything including modifying the JCE editor, all my CSS templates and the article HTML, I'm at a loss at how to consistently control table alignment.

I want to be able to align some columns with images+text centered, and have other columns in the same table with images+text left justified.

I'm really astounded that a massive program like Joomla hasn't addressed this issue.

You can see an example of the problem here :
http://www.parralox.com/index.php?option=com_content&view=article&id=94:enjoy-the-silence&catid=80:discography&Itemid=531

Can someone help me please? :D

Thanks
User avatar
Junior Boarder

GK User
Sat Jul 13, 2013 7:54 pm
Hi,
GREEN BOX

Code: Select all
<div style="margin: auto 0;width:315px;height:200px;"><img width="200" height="200" src="images/cd_enjoy_the_silence_200.jpg" style="margin:2px 55px" alt="cd enjoy the silence 200"></div>
<p> YOUR TEXT</p> 


RED BOX
Use my code
Code: Select all
<td valign="middle" align="center" style="background-color: #e61414; width: 33%;vertical-align: middle;">


AFTER MY CHANGES
after.png


VIOLET BOX
It's ok or not? I'm not sure
User avatar
Platinum Boarder

GK User
Sun Jul 14, 2013 2:01 am
Hi Pavel,
Thanks for the quick reply :)
I'll give that a try and let you know how it goes.
Thanks, John
User avatar
Junior Boarder

GK User
Sun Jul 14, 2013 3:53 am
Hi Pawel.
Wow! Thank you SO much. Your code worked perfectly. 8-)
Hopefully other users will see this post too, as there was lots of complicated info on how to deal with table alignment, but none that worked while using the Gavick templates.
Your solution is simple and elegant.
Thanks,
John
User avatar
Junior Boarder

GK User
Sun Jul 14, 2013 7:43 am
No problem, it was a little bit hard for you because <td> has it's own style inside stylesheets
here: templates/gk_myfolio/css/joomla.css
and we had to use a style="..." to override it in this case.
User avatar
Platinum Boarder

GK User
Sun Jul 14, 2013 7:50 am
Is it possible to disable all table style formatting in the stylesheets, so that it's derived directly from the article itself?
Previously I tried to modify the joomla.css and template.css without luck.
If not, at least I have the solution above.
User avatar
Junior Boarder

GK User
Sun Jul 14, 2013 8:06 am
Hi Pawel,
Just one final question.
What code can I use to add four jpg icons (center aligned) underneath the main 200x200 px jpg image within the same table?

I've attached an image to show you what I'm trying to achieve.

Image

Thanks, John
User avatar
Junior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.