Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

How to Override Table CSS?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 29, 2009, 03:51 PM
jkestler
 
4 posts · Feb 2009
I'd like to style a few HTML tables differently from the theme's "global" styling that I'm using on most pages. The usual methods--CSS inserts, inline CSS--don't seem to work on tables.

Any help is much appreciated!
  #2  
Old Apr 29, 2009, 08:09 PM
Flynn's Avatar
Flynn
 
3,766 posts · Oct 2008
Munich, Germany
Are you giving the tables a class or better, an ID, so you can address them through CSS?

<table id="table-3">....
</table>


CSS Insert:

HTML Code:
table#table-3 {
...
}
table#table-3 td {
...
}
  #3  
Old Apr 29, 2009, 10:31 PM
jkestler
 
4 posts · Feb 2009
Thanks very much.

Turns out the problem was that the CSS override didn't take effect until I published. In "preview" or "private" the default CSS applied, apparently.
  #4  
Old Aug 15, 2009, 02:37 PM
jankph
 
92 posts · Jul 2009
ATA 3.6.4 and WP 3.1
Overriding table CSS - styling table cells

Is it possible to expand on this? E.g. styling individual cells within the selected table, as in

Code:
table#table-3 td#td-1 {
font-color:#666666;
}
I tried the above, but I cannot make it work
  #5  
Old Aug 16, 2009, 05:46 AM
Flynn's Avatar
Flynn
 
3,766 posts · Oct 2008
Munich, Germany
If the table TD cells don't have this class td-1 then it won't work. If you're creating the table yourself you could add the class

<table>
<tr>
<td class="td-1">...</td>
<td class="td-2">...</td>
<td class="td-3">...</td>
</tr>
</table>

CSS Insert

td.td-1 {
color:#666666;
}
td.td-2 {
color:#777777;
}
td.td-3 {
color:#888888;
}

Also, it's color, not font-color
  #6  
Old Aug 16, 2009, 02:09 PM
jankph
 
92 posts · Jul 2009
ATA 3.6.4 and WP 3.1
Thanks. It works.

I'm still a CSS novice, and I couldn't see the difference between id (for the table) and class (for the cell), let alone the color thing. Better read up on that subject, I guess.
  #7  
Old Aug 16, 2009, 02:35 PM
Flynn's Avatar
Flynn
 
3,766 posts · Oct 2008
Munich, Germany
A ID should only appear once on a page. A class can appear multiple times, on multiple, even different elements: <div class="myclass"><span class="myclass">

I suggest to give elements both an ID and a class. That way you can "group style" all elements with the same class, and then, if required give each element an additional, individual style through its ID.

HTML:
<div id="myid" class="myclass">...</div><div id="otherid" class="myclass">...</div><div id="thirdid" class="myclass">...</div>

CSS:
div.myclass { width: 300px }
div#myid { background: red }
div#otherid { background: green }
div#thirdid { background: blue }

All 3 DIV#s will be 300 pixels wide, but each one has a different background color.

An ID has higher priority than a class:

HTML:
<table id="myid" class="myclass">

CSS:
table#myid { background: green }
table.myclass { background: red }

The table background will be green even though the red color was applied after the green color, and due to the CSS rule "later rule takes precedence over earlier rule" it should be red. But the table was already given the color green through its ID, and the class cannot overwrite the ID.

In CSS, ID's are referenced with a hash sign, classes with a dot

selector.classname { property: value; property2: value2 }
selector#idname { property: value; property2: value2 }

The selector (a HTML tag such as table, td, div, span, hr, p, a, ...) can be abandoned but should not (in my opinion) to avoid possible conflicts and unexpected results:

.classname { property: value; property2: value2 }
#idname { property: value; property2: value2 }

... unless it is desired to style multiple elements with the same classname. Then it can make sense to leave out the selector name (as shown above) for the sake of shorter code

It is also possible to apply CSS without ID's or classes, with just the selector. This is a shotgun approach as it will be applied to all matches on the given page:

p { property: value; property2: value2 }

... styles all paragraphs on the page.
  #8  
Old Nov 22, 2011, 05:08 PM
JaneFancher
 
16 posts · Nov 2011
Is there just a way to get rid of the theme's default handling of tables? I use tables a lot in a variety of different ways and it's extremely disconcerting to have code I've used for twenty years have no effect on the site.


Thanks in advance.
  #9  
Old Nov 22, 2011, 05:52 PM
juggledad's Avatar
juggledad
 
22,379 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Go to the table option and blank things out
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Dec 26, 2011, 06:22 PM
adwindham
 
7 posts · Oct 2010
Where should the CSS that overrides the table settings from the theme go? In the css.php? Which part?
  #11  
Old Dec 26, 2011, 06:45 PM
juggledad's Avatar
juggledad
 
22,379 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
You never have to edit CSS.php, just put any overrides in ato->add HTML/CSS inserts->CSS inserts and then they become a theme option
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to override Atahualpa default 404's? gjt Atahualpa 3 Wordpress theme 11 Dec 10, 2012 07:37 PM
[SOLVED] Problem with table styling Edu_Sanzio Atahualpa 3 Wordpress theme 3 Jul 9, 2009 06:22 AM
Big gap before my table renders shilldiy Atahualpa 3 Wordpress theme 4 Apr 14, 2009 03:40 AM
How to override CSS in widget "Text" ?? joe hark Sidebars & Widgets 2 Mar 1, 2009 11:43 PM
Editing the table style and in the posts kirinafa Atahualpa 3 Wordpress theme 1 Mar 1, 2009 04:54 PM


All times are GMT -6. The time now is 07:27 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.