aspose file tools*
The moose likes Struts and the fly likes How can I center html:errors in a table? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How can I center html:errors in a table?" Watch "How can I center html:errors in a table?" New topic
Author

How can I center html:errors in a table?

matt love
Ranch Hand

Joined: Jan 25, 2010
Posts: 67
2 formatting questions:

1 - How can I center in a table td what html:errors generates? The code I have puts the output right of center (see code below)?

2 - What is the CSS code to make the text coming from html:errors red?

Many Thanks.

Matt



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

CSS knows nothing about Struts tags (which are evaluated on the server to generate the HTML to send to the browser), so inspecting Struts markup for CSS issues isn't a useful exercise.

Rather, inspect the generated HTML page to see what you'll be working with on the client side.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
matt love
Ranch Hand

Joined: Jan 25, 2010
Posts: 67
Thank you Bear.

I'm presuming it's the ActionServlet which converts the struts html:errors tag to the unordered list (ul) tag that is received by the browser.

I'm theorizing that if I could pass the line-item (li) attribute "list-style-type:none" to the browser, then with the removal of the list-item marker, the text would center within the cell.

So, how do I send an instruction to the ActionServlet that I want to specify an attributes value for li? Barring any incoming values, I suspect li just uses the default for list-style-type.

According to the ActionMessage API, one form of the ActionMessage constructor is:
public ActionMessage(java.lang.String key, java.lang.Object[] replacementValues) (or you can send a limited number of replacement values without the array).

I’m wondering if the "replacementValues" is the means to interact with the li html in the browser.

Anyway, this is what is in my jsp:



Here's what I see when I view the source in the browser:


If I’m on the right track, can you point me to a sample of how replacement values might look to affect an html li attribute – I’ve tried search engines.

Thanks.

Matt

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

As this has become a question about Struts tags, it's now in the Struts forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I center html:errors in a table?