• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CSS Background Color and Absolute Postioning

 
Ranch Hand
Posts: 70
IBM DB2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
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
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
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
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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic