File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CSS Background Color and Absolute Postioning

 
Joe Brigs
Ranch Hand
Posts: 70
IBM DB2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP that's rendering Data from an Array that gets built from data from a DB. Each record in the array is displayed on a separate line with an empty line between it. The line with data is a shade of blue and the line without data is grey. Each Line contains 11 columns but the data in each column can and does vary in length , When I don't use any CSS each column displays next to each other correctly along with the correct "shade of blue" But Once I add the CSS "position: absolute;" The columns line up nicely but the background color disappears. If I remove the absolute position to the column farthest to the right, this columns data overlaps the 1st but the other 10 columns line up correctly and the background color is also correct. I have attached a little of the code. Any ideas is appreciated. Thanks
imageCount is the last column on the right side of screen
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolute positioning is rarely the right thing to do and is vastly overused/misused. Before any more head-scratching, I'd try to get the desired effect without absolute positioning.
 
Joe Brigs
Ranch Hand
Posts: 70
IBM DB2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Tables ? I was trying to stay away from them becasue some HTML books say its old school. Any other suggestions ? Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nowhere did I mention tables.

By the way, tables as a substitute for CSS, yes, is bad. Tables for tables is fine.

I see a lot of knee-jerk "don't use tables!" nonsense. Tables are fine for what they are supposed to be used for.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not use tables for layout. You use tables when you need to display data in a tabular layout.

Without seeing the actual code, it is impossible to tell you what is a matter. Maybe post a small sample that shows the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic