Fortebello Posted March 30, 2011 Report Share Posted March 30, 2011 I have a question about web design. In a table, I want to put a background of a rectangle with rounded edges. I used PhotoShop to create the rounded rectangle. I saved it as a .png file and placed the graphic into the table using the background attribute it the table tag. So far so good. The problem I have is that the rounded edge on the left side of the table is fine, but I cannot get the graphic to automatically fit the table so the rounded edge appears on the right side of the table also. So what I have now is a lopsided rounded rectangle with a pointy edge on the upper right.. You can see the results of my little creation at www.hearttransactions.com. Any advice you may be able to give will be greatly appreciated. Thanks, Quote Link to comment Share on other sites More sharing options...
Andrea Posted March 30, 2011 Report Share Posted March 30, 2011 It would be much better and cleaner design if you didn't use tables for your layout. That's what CSS is for. Tables are only meant to be used to display tabular data. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted March 30, 2011 Report Share Posted March 30, 2011 In short -- you really can't, if you are using a table that changes width. The only way around that would be to use multiple images, one for the left corner, and one for the right, and make one a background on the table (left aligned) and one on an element wrapping the table (right aligned). As Andrea said though, tables are intended to be used for tabular data, not layout. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted March 31, 2011 Report Share Posted March 31, 2011 One thing I forgot to mention... it is possible to do this with CSS3's rounded corners, though I'm not sure how well it would work since your corners are rather large and of course this doesn't work in all browsers: http://www.css3.info/preview/rounded-border/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.