Thread: HTML and Style Sheets

  1. #1
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401

    HTML and Style Sheets

    It's a slow day at work, so I'm playing with stuff that I don't know much about. I'm reading in a bitmap stored with indexed color, writing out the color palette, and then I want to write a table of pixels that should look like the picture.

    The problem I'm running into is that I've defined the style sheet as follows:
    Code:
    td { width:20px; height:20px }
    .color0 { background-color:rgb(0,0,0) } //etc
    Each td has a class attribute that defines the background color for that cell. Of course, I can't define the td tag to have a width of 20px in some places and 1px in other places. I can't really define the width in the color either. So I tried something like this:
    Code:
    .colorcell { width:20px; height:20px }
    .pixelcell { width:1px; height:1px }
    .color0 { background-color:rgb(0,0,0) } //etc
    However, I don't think you can give cells two classes. Anyone know how to get around this problem?
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  2. #2
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    I'm not quite sure with what you want to accomplish. Can you upload the picture? How 'bout having 20 1px's (if it's relevant at all)?
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. link formatting within tables (html)
    By MisterSako in forum Tech Board
    Replies: 4
    Last Post: 02-28-2006, 06:11 PM
  2. ChatRoom (msn style) Please Help!
    By SteveAlmighty in forum C++ Programming
    Replies: 4
    Last Post: 09-06-2005, 04:30 PM
  3. Syntax to HTML
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-17-2003, 05:46 PM
  4. Style sheet problem.
    By adrianxw in forum Tech Board
    Replies: 1
    Last Post: 05-04-2003, 05:18 PM