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?
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.
| 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 
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.
You could make a php image gradient so the code can be easily changed.
why dont you want an image?
you could use a dynamically generated image (through javascript), although this requires Canvas
| 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  |
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
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.
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...
| 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
Thanks for the tips but,,, just realised that image is the best way cus it saves coding/page length.