Hi, I'm having an issue that I don't find the solution. I've defined a css rule for the tables on a WP website. table { border:1px #F6903C solid; margin: 0; padding: 10; border-collapse: collapse; border-spacing: 0; } Code (markup): But I've a table that I really don't want to have the border, and even by adding: <table border="0px" ... Code (markup): or defining a different css rule class <table class="another_table"... Code (markup): it stills showing the border. Any help, please
Try this: .another_table { border: none; } Code (markup): Oh and in straight html... correction to your statement is: <table border="0"> Code (markup): without the px portion. Hope that helps, Cheers!~
I just thought i'd explain alittle more about what workingsmart has suggested. His first suggestion is using a "class" CSS Code .classname { background:#000; } Code (markup): to identify a class for your table HTML Tag <table class="classname" > Code (markup): With a class you can use this on as many tags as you like. When i prefer to style only one tag i use an id CSS Code #idname {background:#FFF;} Code (markup): HTML Tag <table id="idname" > Code (markup): Hope this helps someone
What in the world was the point in doing that?.... The guy had a border issue... What is class/id's going to do?... Should read the OP's post!! Cheers!~
Exactly!! But, if the OP has tables, then the OP has tables... Least we can do is help him with what he's got!! Cheers!~
#ID should only be used per item... it works great for things like #wrapper #header #logo - things that are not going to change. .class should be used for everything else... .padding_left .blue_text .blue_box .clr - you can take and apply multiple classes to an object - <div class="clr blue_box"
what do you mean; should I use a class instead of an id for this case. Even if it is a particular table?
You might of solved his problem but i hopefully have stopped him from having the same problem again. Helping someone to learn is better then telling someone what to code. Next time think about what your going to type before you type it.
I thought about what I wrote AS I TYPED IT... If you want to get technical your explanation was an incorrect assumption anyway... So, if you want I'll gladly spell out how your explanation and or example was only half correct. The guy has a tabled area on his site, learning is fantastic and the OP was actually half correct as well, just needed clarification to resolve his problem and LEARN along the way. Giving people too much information stemming from a very simple issue can be overwhelming to absorb and may not be taken into context as directed therefore showing him the HALF INCORRECT part of "his own solution" helped him LEARN the other HALF. As for YOUR statement of - "When i prefer to style only one tag i use an id" - It isn't a preference, but a proper way to write code. I wasn't trying to pick or start an argument with you and nor am I now, was merely pointing out that, although you were doing GOOD by posting, it was a bit more overkill than necessary... Cheers!~ Don't worry, go to Happy Hour, have a drink and be Happy!!
If you have multiple tables in any area, only 1 should/can have a particular ID the others, if similar should be CLASSES. If the tables all have common styles you could just inherit the styles by simply styling the <table> tag like: table { border: 1px solid #000; } Code (markup): If a particular table is not to have a border, than that table can have a class: .noborder { border: none; } Code (markup): If you have 1 instance of a particular table, especially if it is a PARENT to a bunch of inner tags, elements, etc than that table should have an ID: #thistable { border: 3px solid red; } Code (markup): In any case an ID should/can only be used 1x per page. Classes can be used multiple times per page. Hope this helps... @hypokill = If left something out, please add to it! Cheers!~
Really at the end of the day it was just more information for those who read the thread and had the same issues. Also i know it's not a personal preference, read the line again. When I prefer to style one tag i use an id, in other words an id is in order when i decide to style one tag. Either way i was just trying to link the missing dots that this thread hadn't filled in. No harm done Edit: Nicely explained, Hopefully this thread can help more people then it is intended to