FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Gradient Fill Cell





ThePolemistis
HI,

I have a table with many cells.
I want to gradiant fill a cell from grey to light grey through code and not image.

Can this be done?
qscomputing
If you want a gradient in each cell, then the only way (AFAIK) is an image.

OTOH, if you have a huge long table and want each row to be a slightly darker shade than the last, then yes that is possible.

HTH.
ThePolemistis
qscomputing wrote:
If you want a gradient in each cell, then the only way (AFAIK) is an image.

OTOH, if you have a huge long table and want each row to be a slightly darker shade than the last, then yes that is possible.

HTH.


cheers... i wanted to have a gradient through code cus taht way if the website theme was blue, then the gradiant would change to blue as well,,, without the need to change picture (since no picture would exist).

However, since this is not possible, guess I will need to create a thin image with the gradiant and repeat it Smile
imagefree
yes its the best choice and will be almost like a simple code.
And if you repeat the same image in many cells, there will be multiple benifit for you that you that the browser will not need to load an additional image.

But remember it will work only if you are going to make up to down and right to left gradients, if there is even a smaller change you want, it would be impossible in this case.
Dougie1
You could make a php image gradient so the code can be easily changed.
jabapyth
why dont you want an image?

you could use a dynamically generated image (through javascript), although this requires Canvas
Fuzzy-Duck
ThePolemistis wrote:
I want to gradiant fill a cell from grey to light grey through code and not image.


ThePolemistis wrote:
i wanted to have a gradient through code cus taht way if the website theme was blue, then the gradiant would change to blue as well,,, without the need to change picture (since no picture would exist).

However, since this is not possible, guess I will need to create a thin image with the gradiant and repeat it Smile


Just a thought, but you can almost achieve the desired effect with images, if I follow what you mean. That is, you can use an image but have the colour of the gradient fill adapt to the colors you set in your stylesheet or the HTML. Without using any propriety server-side shenannigans.

All you would need to do is create a tall narrow gradient-filled image file, as you would normally do in these cases. However, what you need to do is create a greyscale image, and then have the fill going from (say) 50% transparent to completely transparent. Then (ta-daa!) if you save the image as a *.png file, it will automatically adapt to show through between 50% and 100% of your background fill colour on your table cells!!

Easy!! The only drawback of course is that it would only be able to display a gradient fill going from the actual background colour to a darker shade (or vice versa) but I don't see that being too much of a problem for simple table gradient fills.

Hope this helps,
Cheers,
fuzzy
ammonkc
I'm sure an image would be the a lot simpler than any code generated solution like with libGD or something like that. Its really not that hard to make a gradient image in photoshop or something like that.
Azmo
yes an image would be the easiest way of doing this... but it's up to you, you still have to make a different style for your blue, green, red theme etc...
bgillingham
Dougie1 wrote:
You could make a php image gradient so the code can be easily changed.
speaking of php code you'd need to do this, I could post it here - if that's what you wanted. You'd need to edit the code to either create a png or gif file based on the colors, or use the values in your table cell background colors. Check my testing page : http://betterwindowssoftware.com/gradienttesting.php
ThePolemistis
Thanks for the tips but,,, just realised that image is the best way cus it saves coding/page length.
Related topics
Firm claims fuel cell breakthrough
Splinter cell : Pandora ONLINE
Tieskevo's HOW TO MAKE AN REAL NICE LAYOUT TUTORIAL
Create a smooth stylish navigation for your web site.
Cellpadding of single cell
types of cell phones?
Create the Flash Logo (Photoshop Tutorial)
Create the Flash Logo (Photoshop Tutorial)
website in flash
PHP OOP Tutorial
Google, Yahoo! expand cell-phone options
CSS - CSS Tutorial for skin maker
MP3 Player Interface - Create a simple MP3 player style i
[photoshop]Brushed Metal
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.