Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How can I center html:errors in a table?

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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



 
Sheriff
Posts: 67620
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
matt love
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67620
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this has become a question about Struts tags, it's now in the Struts forum.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic