- This topic is empty.
-
AuthorPosts
-
January 23, 2013 at 5:09 am #42177Historical Forums UserParticipant
Hi guys,
Quick and simple hopefully. Take a look at the page I’ve linked below. All of the info (pics,blurb,audio players) is in a table. I created the table in MS Word and literally copied and pasted the table into word press which it apparently likes. However sometimes it doesn’t remember all the formatting so I was wondering if you could let me know the code that will allow me to vertically centre align everything that is in the table? If come across ‘vlign’ but haven’t managed to make it work for me yet.
http://dnaproductionsuk.com/home/audio-mixing-mastering/
Any help appreciated. Any code is fine. I realise I’m in a CSS forum but if you know html to solve it that’s just as good.
Thanks!
January 23, 2013 at 5:22 am #121987Kitty GiraudelParticipantI’d go with
vertical-align: middle;
on both th and td tags.January 23, 2013 at 5:34 am #121988Historical Forums UserParticipantHey Hugo thanks for getting back.
I’ve tried that yes, seems logical but I haven’t got it to work. Here is the code for the first row of my table. See anything wrong with it that would mean all columns of that row wouldn’t align?
MOD EDIT: Unviewable Code Removed
January 23, 2013 at 5:36 am #121999Historical Forums UserParticipantIt won’t let me post it. Any chance you can check the source code for that page?
January 23, 2013 at 5:57 am #121998Paulie_DMemberYou certainly need to remove the inline styling (which is wrong anyway).
Add: vertical-align: middle;
to line 3466/7 + in your CSS sheet
.entry-content td,
.comment-content td {
border-top: 1px solid #ddd;
padding: 6px 10px 6px 0;
vertical-align: middle;
}I do think, however, that you might want to think about converting that table into a series of divs.
January 23, 2013 at 6:02 am #121993Historical Forums UserParticipantAh great thanks, that’s done it. Could you tell me, does that apply to every table in the site? If not, what section of the code ‘directs’ it to this particular table?
January 23, 2013 at 6:08 am #121995Paulie_DMemberIt will apply to all tables **within divs with a class of “entry-content” or “comment-content”**.
January 23, 2013 at 6:27 am #122000Historical Forums UserParticipantI’m used to dabble in a bit of C++ so I’m thinking along those lines… How do I ‘declare’ this table to have the class of entry-content? Obviously it has been done but by word press for me! Thanks for your help!
January 23, 2013 at 6:45 am #122002Paulie_DMemberThe table doesn’t have that class, the div in which the table is sitting has that class.
I have little knowledge of WP but my assumption is that every post/entry is given a div in which to sit and that’s what you have pasted you table into.
January 23, 2013 at 10:55 am #122017Historical Forums UserParticipantThat would make sense yes. I’ve just noticed that it has changed the homepage items within the table as well. do you know how I would say, change table in page #x rather than the whole div? At the moment it reads
.entry-content td,
.comment-content td {
border-top: 1px solid #ddd;
padding: 6px 10px 6px 0;
vertical-align: middle;
}So I just need to change .entry comment td to maybe the page id td? does that sound right?
January 23, 2013 at 11:01 am #122019Paulie_DMemberWell…obviously, it’s really ‘old style’ to be using tables at all….
However, if you want that vertical alignment on a **specific page** only then you will have identify the ID that goes with your page (.page-id-321 I think.)
As I sad though, you should be moving away from tables and perhaps thinking of using a custom post type or a wrapping div with a special class.
As always, there are better people than me at WP…in fact, anyone is better than me.
January 23, 2013 at 11:07 am #122022Historical Forums UserParticipantThere’s maybe better people out there at WP but none quite as good at hitting the nail directly on the head! Thanks, that’s done it. I will certainly be looking into wrapping divs for round 2 of website updates but for now I just need this thing up there and looking good! Thanks again!
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.