*Greg Ludington* ,thanks for your particular advice. I continue to discuss this topic because the deadline of my little project is coming to hand in to my tutor. You way seems to be awesome .However,the display-tag uses css file (*.css) and I should import those four css files into my page for <displaytag:table .../> And these css files would apply to the whole site which is NOT I would like. I include the struts menu page namelly menu.jsp and the usingdisplaytag.jsp to my Tiles page definition.
I write a post in display-tag userlist to find no replay for two days. If i change the css files,the displaytag table's style would be changed.Andit would be the same as the struts menu as the css file I import in the usingdisplaytag.jsp page would apply to the whole site,no only that page! The problem is that I can NOT override it as I tried to name a different style for my struts menu. Strange,isn't it? Thanks for reading,sir. On 5/22/06, Greg Ludington <[EMAIL PROTECTED]> wrote:
You are not going to adjust the scope of a css file, but you will have to change your HTML to give the browser some means of telling your two tables apart, and then adjust your css accordingly. Most often, this is done by putting a class on the html, e.g. <td class="menuClass">. Then, your css could be: td.menuClass {this style would only be applied to the menu td} td.displayTagClass {this style would only be applied to the display tag td} I have not used either Struts-Menu or DisplayTag, so I do not know if you can specify css classes to use in the HTML they generate. I am guessing that you can, but, even if you cannot, you can still apply css to precise areas by containing them in other elements, and writing your css accordingly. Here is a quick example: <html> <head> <style> table { font-family:arial,helvetica} #foo table { color:red} #bar table { color:green} </style> </head> <body> <div id="foo"> <table> <tr><td>I am red arial</td></tr> </table> </div> <div id="bar"> <table> <tr><td>I am green arial</td></tr> </table> </div> </body> </html> In this page, all tables are arial,hevetica, but only tables inside the "foo" element are red, and only tables inside the "bar" element are green. You have to alter your HTML to give css knoweldge of where to apply rules, and then change your css in ways like these so that they only apply to the areas of the page that you need. There are other methods, as well, but a full discussion of css inheritance is beyond the scope of this list, and probably my abilities as well :) Here is a good link as a starting point: http://www.simplebits.com/notebook/2003/04/15/css_inheritance.html hth, Greg On 5/21/06, M.Liang Liu <[EMAIL PROTECTED]> wrote: > Greg Ludington,you've got the point. > I tested many times to find it is the CSS file that made the strange rim.The > CSS files apply to all the pages using display-tag.I do NOT know > how to limit the scope of the CSS files' application areas. > > I am trying eXtremeComponents following *David G. Friedman's *advice*. > > *And,David G. Friedman,I've got another question for you: > > How can you limit the scope of the CSS files ?Any table(including the table > which is not the display-tag table) will be applied to the same CSS if I > use display-tag's CSS file as following: > > ...... > > > </head> > > <link rel="stylesheet" type="text/css" href="css/maven-base.css"> > > <link rel="stylesheet" type="text/css" href="css/maven-theme.css"> > > <link rel="stylesheet" type="text/css" href="css/site.css"> > > <link rel="stylesheet" type="text/css" href="css/screen.css"> > > <body> > > **....... > > > Thanks a lot. > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- http://blog.csdn.net/patriotlml Drink Drank Drunk http://my.donews.com/patriotlml/