Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create square shaped table cell
which will have grey color in lower triangle and blue in upper triangle.
Posted
Updated 18-Dec-12 2:09am
v2
Comments
Avinash_Pathak 18-Dec-12 6:27am    
take two div in your td and pass different color to them...
deepakdynamite 18-Dec-12 6:40am    
Yes that can be done but shape is some like [\] square divided by back slash... your suggestion won't work in this case
Niral Soni 18-Dec-12 7:10am    
What is the agenda behind this question ? through HTML/CSS its not possible to create any shape other than rectangle/square.

You can create two different triangle images with required colors and set them as a background of div, position div elements such that your required shape gets created.

Or else, make use of CANVAS tag in HTML to achieve this.

Create an image with different colors in the triangle shape according to your requirements and then place it as the td background image.

you cannot just set the two different colors shape wise using just HTML or CSS.

using image is a better option.
 
Share this answer
 
Comments
Abhishek Pant 18-Dec-12 9:48am    
:D
[no name] 18-Dec-12 10:33am    
the tutorial u have posted is great ... thanx for contributing, but i would love to implement the requirements given above using the tutorial, any sample code is welcome.
Create the image in paint or a graphics designer like adobe photoshop or which ever you prefer, then add it to the page.

Then you can adjust the transperency to it to give it a specific effect.

That can't fail.

Thanks
 
Share this answer
 
Design this using Canvass or Gradients
Backgrounds & Gradients[^]
A Developer’s Guide to HTML5 Canvas[^]

hope it helped!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900