Table fonts (color & size)

Hi all,

Who can teach me how to change PHP table fonts style as like as CSS?

I have tried to create a CSS and save it as .CCreportTable and insert the code into PHP code like this

echo “

”;

But it isn’t working , someone can help?
Thanks.

Brgds/Brandon Chau

Using CSS:

Place the CSS in the head section of your page - or a separate style sheet.

CSS:

<style type="text/css" media="screen"> .CCreportTable { width:100%; background-color:#ff0000; /* red background */ color: #000000; /* black font */ padding: 10px; border:1px solid #000000; } </style>

HTML:

<table class='CCreportTable'>

and as a bonus, here’s how to change it using jquery :wink:
place this in the head section - after a call to include jquery.
jQuery:

<script type="text/javascript"> $(document).ready(function() { $(".CCreportTable").css('backgroundColor', '#0000ff'); // change bg colour to blue. }); </script>

Hope that helps,
Red :wink:

[quote author=Redscouse link=topic=20771.msg71349#msg71349 date=1372145676]
Using CSS:

When i place the CSS coding in the head section of my page is working, Thank you :smiley:

but may i know why it doesn’t work when i save the CSS coding as separate style sheet , and then i place the link in the head section. Nothing changing :frowning:

and also it doesn’t work using jquery ::slight_smile:

Thank you for the help

Brgds/Brandon Chau

using this line:

the system expects to find a file called WebForm.css in the same directory as the file making the call. Is the file named correctly? Inside the same folder?

The reason it’s not working in jquery is probably due to the fact you haven’t included the jquery itself!
Place this line right before the jquery i included in my first post.

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

no worries, glad to help :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service