Log in

View Full Version : tables id



lord22
07-30-2008, 08:01 AM
Hi

if I have few tables on my page and I want that every table will have it's own style what should I write in my css file?

sorry it's a silly question, I just forgot it :(

rangana
07-30-2008, 08:23 AM
Basically, you have to have a unique id on every table.

With that said, if you the id of table 1 (for instance) is table1, which should look like this:


<table id="table1"><tr><td></td></tr></table>


Then, style it in your CSS by the basic rule:


/*selector{property:value}*/
#table1{background:#fc0;}


Sidenote, if you are designing the page, then stop using tables - it was'nt intended for layouts (http://hotdesign.com/seybold).

Hope that makes sense and thus keeps you going.

lord22
07-30-2008, 08:26 AM
thanks :)