July 4, 200818 yr I am having a little problem with setting a background image for a table and also setting the columns widths. Here is a very dumbed down example. The image is a just a solid 16x16 color. I am using IE 7. I would expect this to have the image vertically repeated on the left hand side of the first column; however, it is also inserting the image on the second column as well. <html> <head> <style type="text/css"> table {background-image: url("image.gif"); background-repeat=repeat-y;} </style> </head> <body> <table> <col width="100"/> <col width="150"/> <tr><td>Cell A1</td><td>Cell B1</td></tr> <tr><td>Cell A2</td><td>Cell B2</td></tr> </table> </body> </html>
July 4, 200818 yr Hi The css will apply that style to the entire table. <style type="text/css"> table {background-image: url("image.gif"); background-repeat=repeat-y;} </style> Pat EDIT: background-repeat=repeat-y; should be background-repeat:repeat-y;
July 4, 200818 yr Author That answer didn't make any sense to me so let me try to explain this in a different way. Why do these two sets of code act differently? Edit: Not suprisingly, these two work the same as expected with Firefox; however, I need to get this working for IE7. <html> <head> <style type="text/css"> table {background-image: url("image.gif"); background-repeat:repeat-y;} </style> </head> <body> <table> <tr><td width="100">Cell A1</td><td width="150">Cell B1</td></tr> <tr><td width="100">Cell A2</td><td width="150">Cell B2</td></tr> </table> </body> </html> <html> <head> <style type="text/css"> table {background-image: url("image.gif"); background-repeat:repeat-y;} </style> </head> <body> <table> <col width="100"/> <col width="150"/> <tr><td>Cell A1</td><td>Cell B1</td></tr> <tr><td>Cell A2</td><td>Cell B2</td></tr> </table> </body> </html>
Create an account or sign in to comment