Welcome Guest, Not a member yet? Register   Sign In
Formatting Tables with CSS
#11

[eluser]pickupman[/eluser]
[quote author="John_Betong" date="1271412331"] 
Try this:
Code:
// old
    <tr class="&lt;?php echo alternator('alt,'');?&gt;">

  // New
    <tr style="&lt;?php echo alternator('background:#cfc','background:#ffc'); ?&gt;">
&nbsp;
&nbsp;
&nbsp;
edit: added missing #[/quote]
Inline style is bad practice as it is a pain to go back and edit the colors. Best to use a css class.
#12

[eluser]John_Betong[/eluser]
[quote author="maniac" date="1271436840"]Sorry, what do you mean?[/quote]

Ideally you should have a CSS file linked in to your web page with a class named .alt

There are many advantages of storing all your CSS statements in a style sheet rather than having inline CSS statements.

Check out W3Schools.com for a comprehensive explanation.
&nbsp;
&nbsp;
&nbsp;
#13

[eluser]maniac[/eluser]
Used the first suggestion and got it working. I originally wrote the class as alternator instead of alt.

Thank you for all your help and patience.

Maniac
#14

[eluser]John_Betong[/eluser]
[quote author="maniac" date="1271483612"]Used the first suggestion and got it working. I originally wrote the class as alternator instead of alt.

Thank you for all your help and patience.

Maniac[/quote]
&nbsp;
&nbsp;
Just came across this web page that details four different methods of using CSS, their individual benefits and/or drawbacks.

http://matthewjamestaylor.com/blog/addin...and-import
&nbsp;
&nbsp;
&nbsp;




Theme © iAndrew 2016 - Forum software by © MyBB