aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes CSS Background Color and Absolute Postioning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "CSS Background Color and Absolute Postioning" Watch "CSS Background Color and Absolute Postioning" New topic
Author

CSS Background Color and Absolute Postioning

Joe Brigs
Ranch Hand

Joined: Jun 06, 2011
Posts: 60

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

Joined: Jan 10, 2002
Posts: 61224
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Brigs
Ranch Hand

Joined: Jun 06, 2011
Posts: 60

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

Joined: Jan 10, 2002
Posts: 61224
    
  66

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
 
subject: CSS Background Color and Absolute Postioning