472,958 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

SQL database structure for CSS?

I'm working on a web application that makes heavy use of CSS, but I
would like users to have a degree of control over some of the classes
and attributes. To accomplish this, I want to store my CSS classes in a
SQL database.

The only problem is, I'm having a heck of a time trying to design the
database tables in a normalized way. I have searched high and low for
examples of CSS entity-relationship diagrams--to no avail.

Has anyone here done something similar, and if so, do you have an
example I can borrow? I feel like I'm reinventing the wheel every time
I take a stab at this, and it is difficult trying to visualize how to
separate the tables. It also seems like it is going to be a ton of
work. For example, I am starting to think there will be no end to the
number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
CssFontFamilies, CssBorderStyles, etc.

Help!
Jul 21 '05 #1
9 9406
In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>, sk****@bones.com says...
I'm working on a web application that makes heavy use of CSS, but I
would like users to have a degree of control over some of the classes
and attributes. To accomplish this, I want to store my CSS classes in a
SQL database.

The only problem is, I'm having a heck of a time trying to design the
database tables in a normalized way. I have searched high and low for
examples of CSS entity-relationship diagrams--to no avail.

Has anyone here done something similar, and if so, do you have an
example I can borrow? I feel like I'm reinventing the wheel every time
I take a stab at this, and it is difficult trying to visualize how to
separate the tables. It also seems like it is going to be a ton of
work. For example, I am starting to think there will be no end to the
number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
CssFontFamilies, CssBorderStyles, etc.


AFAICS, you only need one table with fields for:
at-rule : String
selector : String
property : String
value : String
important : Boolean

Jul 21 '05 #2
In article <1114635447.805e218ca45779b77652af66747f6d39@teran ews>,
Mr.Clean <mrclean@p&g.com> wrote:
In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>,
sk****@bones.com says...
I'm working on a web application that makes heavy use of CSS, but I
would like users to have a degree of control over some of the classes
and attributes. To accomplish this, I want to store my CSS classes in a
SQL database.

The only problem is, I'm having a heck of a time trying to design the
database tables in a normalized way. I have searched high and low for
examples of CSS entity-relationship diagrams--to no avail.

Has anyone here done something similar, and if so, do you have an
example I can borrow? I feel like I'm reinventing the wheel every time
I take a stab at this, and it is difficult trying to visualize how to
separate the tables. It also seems like it is going to be a ton of
work. For example, I am starting to think there will be no end to the
number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
CssFontFamilies, CssBorderStyles, etc.


AFAICS, you only need one table with fields for:
at-rule : String
selector : String
property : String
value : String
important : Boolean


True. It would mean I would have to build a lot of constraints for the
columns, though. For instance, I wouldn't want there to be a chance you
could pick an invalid (or non-web-safe) hexadecimal code for the
colors. Also, I wouldn't want to allow invalid font sets, inappropriate
alignment choices, or non-existent border styles.

Even more importantly, though, if several classes share the same font
family or colors, I wouldn't want to have to manage that information in
multiple rows of a single master table.

What if, for example, one user wants to use a blue theme one day and a
green theme the next? I would have to change a hexadecimal value in
multiple rows, rather than one row in one table. Even though I still
can't visualize it, I think there must be a way to normalize CSS
relationships.
Jul 21 '05 #3
On Wed, 27 Apr 2005 16:29:03 -0500, in
comp.infosystems.www.authoring.stylesheets Big Slim <sk****@bones.com>
wrote:
| In article <1114635447.805e218ca45779b77652af66747f6d39@teran ews>,
| Mr.Clean <mrclean@p&g.com> wrote:
|
| > In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>,
| > sk****@bones.com says...
| > > I'm working on a web application that makes heavy use of CSS, but I
| > > would like users to have a degree of control over some of the classes
| > > and attributes. To accomplish this, I want to store my CSS classes in a
| > > SQL database.
| > >
| > > The only problem is, I'm having a heck of a time trying to design the
| > > database tables in a normalized way. I have searched high and low for
| > > examples of CSS entity-relationship diagrams--to no avail.
| > >
| > > Has anyone here done something similar, and if so, do you have an
| > > example I can borrow? I feel like I'm reinventing the wheel every time
| > > I take a stab at this, and it is difficult trying to visualize how to
| > > separate the tables. It also seems like it is going to be a ton of
| > > work. For example, I am starting to think there will be no end to the
| > > number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
| > > CssFontFamilies, CssBorderStyles, etc.
| >
| > AFAICS, you only need one table with fields for:
| > at-rule : String
| > selector : String
| > property : String
| > value : String
| > important : Boolean
| >
|
| True. It would mean I would have to build a lot of constraints for the
| columns, though. For instance, I wouldn't want there to be a chance you
| could pick an invalid (or non-web-safe) hexadecimal code for the
| colors. Also, I wouldn't want to allow invalid font sets, inappropriate
| alignment choices, or non-existent border styles.
|
| Even more importantly, though, if several classes share the same font
| family or colors, I wouldn't want to have to manage that information in
| multiple rows of a single master table.
|
| What if, for example, one user wants to use a blue theme one day and a
| green theme the next? I would have to change a hexadecimal value in
| multiple rows, rather than one row in one table. Even though I still
| can't visualize it, I think there must be a way to normalize CSS
| relationships.


I think that you are making this far too complicated. Your users would
have to have a good grasp of CSS to alter their schemes. You would
also need to write a full blown CSS application (ala TopStyle) just to
maintain the information and valid options.

What I have found is that user wants to have a selection of colour and
layout choices. They want to view the different options and just click
a button. This can be achieved by using predefined CSS files. The user
selection is saved to the database, read when they log in and applied
to each page that they view.
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 21 '05 #4
Jeff North wrote:
On Wed, 27 Apr 2005 16:29:03 -0500, in
comp.infosystems.www.authoring.stylesheets Big Slim <sk****@bones.com>
wrote:

| In article <1114635447.805e218ca45779b77652af66747f6d39@teran ews>,
| Mr.Clean <mrclean@p&g.com> wrote:
|
| > In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>,
| > sk****@bones.com says...
| > > I'm working on a web application that makes heavy use of CSS, but I
| > > would like users to have a degree of control over some of the classes
| > > and attributes. To accomplish this, I want to store my CSS classes in a
| > > SQL database.
| > >
| > > The only problem is, I'm having a heck of a time trying to design the
| > > database tables in a normalized way. I have searched high and low for
| > > examples of CSS entity-relationship diagrams--to no avail.
| > >
| > > Has anyone here done something similar, and if so, do you have an
| > > example I can borrow? I feel like I'm reinventing the wheel every time
| > > I take a stab at this, and it is difficult trying to visualize how to
| > > separate the tables. It also seems like it is going to be a ton of
| > > work. For example, I am starting to think there will be no end to the
| > > number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
| > > CssFontFamilies, CssBorderStyles, etc.
| >
| > AFAICS, you only need one table with fields for:
| > at-rule : String
| > selector : String
| > property : String
| > value : String
| > important : Boolean
| >
|
| True. It would mean I would have to build a lot of constraints for the
| columns, though. For instance, I wouldn't want there to be a chance you
| could pick an invalid (or non-web-safe) hexadecimal code for the
| colors. Also, I wouldn't want to allow invalid font sets, inappropriate
| alignment choices, or non-existent border styles.
|
| Even more importantly, though, if several classes share the same font
| family or colors, I wouldn't want to have to manage that information in
| multiple rows of a single master table.
|
| What if, for example, one user wants to use a blue theme one day and a
| green theme the next? I would have to change a hexadecimal value in
| multiple rows, rather than one row in one table. Even though I still
| can't visualize it, I think there must be a way to normalize CSS
| relationships.

I think that you are making this far too complicated. Your users would
have to have a good grasp of CSS to alter their schemes. You would
also need to write a full blown CSS application (ala TopStyle) just to
maintain the information and valid options.

What I have found is that user wants to have a selection of colour and
layout choices. They want to view the different options and just click
a button. This can be achieved by using predefined CSS files. The user
selection is saved to the database, read when they log in and applied
to each page that they view.


make me wonder what the OP's intentions are with this rather complex
construction. maybe mr S could elaborate a little on this ?
Jul 21 '05 #5
"Big Slim" <sk****@bones.com> wrote in message
news:1114633159.afc5e0ddeb0e4458d0312b537b89968e@t eranews...
I'm working on a web application that makes heavy use of CSS, but I
would like users to have a degree of control over some of the classes
and attributes. To accomplish this, I want to store my CSS classes in a
SQL database.

The only problem is, I'm having a heck of a time trying to design the
database tables in a normalized way. I have searched high and low for
examples of CSS entity-relationship diagrams--to no avail.

Has anyone here done something similar, and if so, do you have an
example I can borrow? I feel like I'm reinventing the wheel every time
I take a stab at this, and it is difficult trying to visualize how to
separate the tables. It also seems like it is going to be a ton of
work. For example, I am starting to think there will be no end to the
number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
CssFontFamilies, CssBorderStyles, etc.


Are you trying to create user-configurable styles, so users can change their
personal view, sort of like how they can change their Windows appearance
settings? If so, please provide me with a few more details - this sounds a
little like something I'm working on at present. Perhaps what I'm doing
would have some relevance.
Jul 21 '05 #6
In article <d4**********@news6.zwoll1.ov.home.nl>, Martin!
<m.*******@gmail.komkommer> wrote:
Jeff North wrote:
On Wed, 27 Apr 2005 16:29:03 -0500, in
comp.infosystems.www.authoring.stylesheets Big Slim <sk****@bones.com>
wrote:

| In article <1114635447.805e218ca45779b77652af66747f6d39@teran ews>,
| Mr.Clean <mrclean@p&g.com> wrote:
|
| > In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>,
| > sk****@bones.com says...
| > > I'm working on a web application that makes heavy use of CSS, but I
| > > would like users to have a degree of control over some of the classes
| > > and attributes. To accomplish this, I want to store my CSS classes in
| > > a
| > > SQL database.
| > >
| > > The only problem is, I'm having a heck of a time trying to design the
| > > database tables in a normalized way. I have searched high and low for
| > > examples of CSS entity-relationship diagrams--to no avail.
| > >
| > > Has anyone here done something similar, and if so, do you have an
| > > example I can borrow? I feel like I'm reinventing the wheel every time
| > > I take a stab at this, and it is difficult trying to visualize how to
| > > separate the tables. It also seems like it is going to be a ton of
| > > work. For example, I am starting to think there will be no end to the
| > > number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
| > > CssFontFamilies, CssBorderStyles, etc.
| >
| > AFAICS, you only need one table with fields for:
| > at-rule : String
| > selector : String
| > property : String
| > value : String
| > important : Boolean
| >
|
| True. It would mean I would have to build a lot of constraints for the
| columns, though. For instance, I wouldn't want there to be a chance you
| could pick an invalid (or non-web-safe) hexadecimal code for the
| colors. Also, I wouldn't want to allow invalid font sets, inappropriate
| alignment choices, or non-existent border styles.
|
| Even more importantly, though, if several classes share the same font
| family or colors, I wouldn't want to have to manage that information in
| multiple rows of a single master table.
|
| What if, for example, one user wants to use a blue theme one day and a
| green theme the next? I would have to change a hexadecimal value in
| multiple rows, rather than one row in one table. Even though I still
| can't visualize it, I think there must be a way to normalize CSS
| relationships.

I think that you are making this far too complicated. Your users would
have to have a good grasp of CSS to alter their schemes. You would
also need to write a full blown CSS application (ala TopStyle) just to
maintain the information and valid options.

What I have found is that user wants to have a selection of colour and
layout choices. They want to view the different options and just click
a button. This can be achieved by using predefined CSS files. The user
selection is saved to the database, read when they log in and applied
to each page that they view.


make me wonder what the OP's intentions are with this rather complex
construction. maybe mr S could elaborate a little on this ?


My intention goes along these lines: a financial web application I am
writing (in Java) retrieves thousands of rows of data from a database.
Depending on the values in one (or more) of the columns, a particular
row of data may or may not be highlighted (i.e., mapped to a particular
CSS class). Also, the highlight color of the row may change depending
on exactly which value appears in the particular column.

An oversimplified example: say there is a price-change column. When the
value in this column is negative, the entire row gets highlighted in
red. When the value is positive, but below a certain number, the row is
not highlighted. When the value is above the threshold number, the row
gets highlighted in blue. Above another number, the row gets
highlighted in green, etc.

Users want to change these highlighting colors to suite their own
tastes. They can already change filters that determine when rows will
be highlighted anyway.

I don't want to deal with separate CSS files. In fact, I don't want any
CSS files at all. Instead, the CSS should be generated dynamically at
compile time in the HEAD area of the page based on CSS information in a
set of SQL tables that get joined to a user account table.

The question is, how would you organize these SQL tables in a way that
is normalized? I wonder if this question belongs in another NG?
Jul 21 '05 #7
On Thu, 28 Apr 2005 13:09:48 -0500, Big Slim wrote:
My intention goes along these lines: a financial web application I am
writing (in Java) retrieves thousands of rows of data from a database.
Depending on the values in one (or more) of the columns, a particular
row of data may or may not be highlighted (i.e., mapped to a particular
CSS class). Also, the highlight color of the row may change depending
on exactly which value appears in the particular column.

An oversimplified example: say there is a price-change column. When the
value in this column is negative, the entire row gets highlighted in
red. When the value is positive, but below a certain number, the row is
not highlighted. When the value is above the threshold number, the row
gets highlighted in blue. Above another number, the row gets
highlighted in green, etc.

Users want to change these highlighting colors to suite their own
tastes. They can already change filters that determine when rows will
be highlighted anyway.

I don't want to deal with separate CSS files. In fact, I don't want any
CSS files at all. Instead, the CSS should be generated dynamically at
compile time in the HEAD area of the page based on CSS information in a
set of SQL tables that get joined to a user account table.

The question is, how would you organize these SQL tables in a way that
is normalized? I wonder if this question belongs in another NG?


Are you only changing colours, or is that just because this is the
"oversimplified" example? From this short example, it sounds like you
must already have some structure for user->threshold lookups. Just add
another column to that, so you do user->(threshold,colour) lookups, and
you're all set. You have to read the thresholds before starting the
report anyway, so so you can grab the colours and generate the CSS in
the header at the same time.

If the real-world version is more complicated, then the solution is
probably also more complicated. Hopefully this points you in the right
direction.

As a side note, which may apply here, I've found that it's best to
design for what you need right now, and accept that you may need to
redesign parts of it later, rather than try to design for all potential
features from the get-go. 90% of the features you allow for will never
get used, and designing them all will take longer than redesigning the
10% you do need when you find that you need it.

--
Greg Schmidt gr***@trawna.com
Trawna Publications http://trawna.com/
Jul 21 '05 #8
On Thu, 28 Apr 2005 13:09:48 -0500, in
comp.infosystems.www.authoring.stylesheets Big Slim <sk****@bones.com>
wrote:
| In article <d4**********@news6.zwoll1.ov.home.nl>, Martin!
| <m.*******@gmail.komkommer> wrote:
|
| > Jeff North wrote:
| > > On Wed, 27 Apr 2005 16:29:03 -0500, in
| > > comp.infosystems.www.authoring.stylesheets Big Slim <sk****@bones.com>
| > > wrote:
| > >
| > >
| > >>| In article <1114635447.805e218ca45779b77652af66747f6d39@teran ews>,
| > >>| Mr.Clean <mrclean@p&g.com> wrote:
| > >>|
| > >>| > In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>,
| > >>| > sk****@bones.com says...
| > >>| > > I'm working on a web application that makes heavy use of CSS, but I
| > >>| > > would like users to have a degree of control over some of the classes
| > >>| > > and attributes. To accomplish this, I want to store my CSS classes in
| > >>| > > a
| > >>| > > SQL database.
| > >>| > >
| > >>| > > The only problem is, I'm having a heck of a time trying to design the
| > >>| > > database tables in a normalized way. I have searched high and low for
| > >>| > > examples of CSS entity-relationship diagrams--to no avail.
| > >>| > >
| > >>| > > Has anyone here done something similar, and if so, do you have an
| > >>| > > example I can borrow? I feel like I'm reinventing the wheel every time
| > >>| > > I take a stab at this, and it is difficult trying to visualize how to
| > >>| > > separate the tables. It also seems like it is going to be a ton of
| > >>| > > work. For example, I am starting to think there will be no end to the
| > >>| > > number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
| > >>| > > CssFontFamilies, CssBorderStyles, etc.
| > >>| >
| > >>| > AFAICS, you only need one table with fields for:
| > >>| > at-rule : String
| > >>| > selector : String
| > >>| > property : String
| > >>| > value : String
| > >>| > important : Boolean
| > >>| >
| > >>|
| > >>| True. It would mean I would have to build a lot of constraints for the
| > >>| columns, though. For instance, I wouldn't want there to be a chance you
| > >>| could pick an invalid (or non-web-safe) hexadecimal code for the
| > >>| colors. Also, I wouldn't want to allow invalid font sets, inappropriate
| > >>| alignment choices, or non-existent border styles.
| > >>|
| > >>| Even more importantly, though, if several classes share the same font
| > >>| family or colors, I wouldn't want to have to manage that information in
| > >>| multiple rows of a single master table.
| > >>|
| > >>| What if, for example, one user wants to use a blue theme one day and a
| > >>| green theme the next? I would have to change a hexadecimal value in
| > >>| multiple rows, rather than one row in one table. Even though I still
| > >>| can't visualize it, I think there must be a way to normalize CSS
| > >>| relationships.
| > >
| > >
| > > I think that you are making this far too complicated. Your users would
| > > have to have a good grasp of CSS to alter their schemes. You would
| > > also need to write a full blown CSS application (ala TopStyle) just to
| > > maintain the information and valid options.
| > >
| > > What I have found is that user wants to have a selection of colour and
| > > layout choices. They want to view the different options and just click
| > > a button. This can be achieved by using predefined CSS files. The user
| > > selection is saved to the database, read when they log in and applied
| > > to each page that they view.
| >
| > make me wonder what the OP's intentions are with this rather complex
| > construction. maybe mr S could elaborate a little on this ?
|
| My intention goes along these lines: a financial web application I am
| writing (in Java) retrieves thousands of rows of data from a database.
| Depending on the values in one (or more) of the columns, a particular
| row of data may or may not be highlighted (i.e., mapped to a particular
| CSS class). Also, the highlight color of the row may change depending
| on exactly which value appears in the particular column.
|
| An oversimplified example: say there is a price-change column. When the
| value in this column is negative, the entire row gets highlighted in
| red. When the value is positive, but below a certain number, the row is
| not highlighted. When the value is above the threshold number, the row
| gets highlighted in blue. Above another number, the row gets
| highlighted in green, etc.
|
| Users want to change these highlighting colors to suite their own
| tastes. They can already change filters that determine when rows will
| be highlighted anyway.
If they only want to change the colours then there is no need for the
complicated rules that you are planning.

In an application that I wrote I allowed the user to change 7
properties, main background colour, font colour, border styles and
colours and layout modes.

I stored this information in a single field in the database i.e.
#FF00FF|#00FF00|1 px solid #FF0000 etc

The server-side would get this data, split it apart and write out the
necessary ccs statements. In jscript it looked like:

var CSS = db.Fields.Item("CSS").Value;
var CSSArray = new Array();
CSSArray = CSS.Split("|");

to generate the client-side CSS I used:

<style>
..mainBG {
background-color: <%=CSSArray[0]%>;
color: <%=CSSArray[3]%>
margin: 0;
padding: 0 4px 0 6px;
}
..hilite { color : <%=CSSArray[1]%>; }
..boxed { <%=CSSArray[2]%>; }
etc etc

The user configuration page consisted only of the items that they were
allowed to change.

If the user wanted a style like:
..mainBG {
background-color: #9400D3;
color: #FF00FF;
font-family: cursive;
font-size: 10px;
font-weight: bold;
}

my coding didn't stop them from having what they wanted. Believe me
someone actually wanted this scheme and dispite the advice from myself
and 2 other graphic designers the user still persisted. It wasn't
until they started getting complaints from their users that they
decided on a different scheme.

The moral of the story: not everyone is a graphic designer (including
myself) so it is up to you, the programmer, to note the users
limitations and set your rules accordingly.

Your configuration page would control the rules i.e. if the user
selected a light colour background then you must offer them an
appropriate contrasting colour for the text colour.

Also, if the user forgot to set an option you must either prompt the
user to set it or user an appropriate default i.e. if the user
selected a dark green background then you wouldn't want the default
text colour of black.
| I don't want to deal with separate CSS files. In fact, I don't want any
| CSS files at all. Instead, the CSS should be generated dynamically at
| compile time in the HEAD area of the page based on CSS information in a
| set of SQL tables that get joined to a user account table.
Agreed. Your further explanation rules out the need for multiple CSS
files.
| The question is, how would you organize these SQL tables in a way that
| is normalized? I wonder if this question belongs in another NG?


No tables, just a single field in a table.
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 21 '05 #9
Big Slim wrote:
In article <d4**********@news6.zwoll1.ov.home.nl>, Martin!
<m.*******@gmail.komkommer> wrote:

Jeff North wrote:
On Wed, 27 Apr 2005 16:29:03 -0500, in
comp.infosystems.www.authoring.stylesheets Big Slim <sk****@bones.com>
wrote:

| In article <1114635447.805e218ca45779b77652af66747f6d39@teran ews>,
| Mr.Clean <mrclean@p&g.com> wrote:
|
| > In article <1114633159.afc5e0ddeb0e4458d0312b537b89968e@teran ews>,
| > sk****@bones.com says...
| > > I'm working on a web application that makes heavy use of CSS, but I
| > > would like users to have a degree of control over some of the classes
| > > and attributes. To accomplish this, I want to store my CSS classes in
| > > a
| > > SQL database.
| > >
| > > The only problem is, I'm having a heck of a time trying to design the
| > > database tables in a normalized way. I have searched high and low for
| > > examples of CSS entity-relationship diagrams--to no avail.
| > >
| > > Has anyone here done something similar, and if so, do you have an
| > > example I can borrow? I feel like I'm reinventing the wheel every time
| > > I take a stab at this, and it is difficult trying to visualize how to
| > > separate the tables. It also seems like it is going to be a ton of
| > > work. For example, I am starting to think there will be no end to the
| > > number of tables I'll need: CssColors, CssAlignments, CssFontStyles,
| > > CssFontFamilies, CssBorderStyles, etc.
| >
| > AFAICS, you only need one table with fields for:
| > at-rule : String
| > selector : String
| > property : String
| > value : String
| > important : Boolean
| >
|
| True. It would mean I would have to build a lot of constraints for the
| columns, though. For instance, I wouldn't want there to be a chance you
| could pick an invalid (or non-web-safe) hexadecimal code for the
| colors. Also, I wouldn't want to allow invalid font sets, inappropriate
| alignment choices, or non-existent border styles.
|
| Even more importantly, though, if several classes share the same font
| family or colors, I wouldn't want to have to manage that information in
| multiple rows of a single master table.
|
| What if, for example, one user wants to use a blue theme one day and a
| green theme the next? I would have to change a hexadecimal value in
| multiple rows, rather than one row in one table. Even though I still
| can't visualize it, I think there must be a way to normalize CSS
| relationships.
I think that you are making this far too complicated. Your users would
have to have a good grasp of CSS to alter their schemes. You would
also need to write a full blown CSS application (ala TopStyle) just to
maintain the information and valid options.

What I have found is that user wants to have a selection of colour and
layout choices. They want to view the different options and just click
a button. This can be achieved by using predefined CSS files. The user
selection is saved to the database, read when they log in and applied
to each page that they view.


make me wonder what the OP's intentions are with this rather complex
construction. maybe mr S could elaborate a little on this ?

My intention goes along these lines: a financial web application I am
writing (in Java) retrieves thousands of rows of data from a database.
Depending on the values in one (or more) of the columns, a particular
row of data may or may not be highlighted (i.e., mapped to a particular
CSS class). Also, the highlight color of the row may change depending
on exactly which value appears in the particular column.

An oversimplified example: say there is a price-change column. When the
value in this column is negative, the entire row gets highlighted in
red. When the value is positive, but below a certain number, the row is
not highlighted. When the value is above the threshold number, the row
gets highlighted in blue. Above another number, the row gets
highlighted in green, etc.

Users want to change these highlighting colors to suite their own
tastes. They can already change filters that determine when rows will
be highlighted anyway.

I don't want to deal with separate CSS files. In fact, I don't want any
CSS files at all. Instead, the CSS should be generated dynamically at
compile time in the HEAD area of the page based on CSS information in a
set of SQL tables that get joined to a user account table.

The question is, how would you organize these SQL tables in a way that
is normalized? I wonder if this question belongs in another NG?

i think what Greg is saying is right.
you could make 1 css file that includes all the variations of styles you
want to use and when you dynamically generate the html you can evaluate
the columns and rows and insert the proper classes to your rows and/or
cells.
remember that css only structures some mark-up issues and is best
conciderred a static part of your html.
and indeed, for the dynamic generation of your code you better ask your
questions in other newsgroups.

gl
martin
Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bryja_klaudiusz[at]poczta[dot]fm | last post by:
Hi, How to copy database diagram (all data) to other server using only MSDE server and VS.Net Proffesional? I have no Enterprice manager. I have to move database (create on my machine) to my...
1
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed...
346
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
25
by: Colin McKinnon | last post by:
Hi all, There's lots of DB abstraction layers out there, but a quick look around them hasn't turned up anything which seems to met my requirements. Before I go off and write one I thought I'd...
3
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news...
1
by: Eric Sadoyama | last post by:
I have a database documentation question, but I am not even sure how to phrase it properly so I don't know where to start looking for answers. We are developing a database that is based on...
1
by: barkana | last post by:
Platform: ANSI C, RTOS Hi, I am trying to fread a database from a text file, and assign the database directly to the public structure below. In the text file first 20 chars is for SKU next 35 chars...
8
by: situ | last post by:
Hello all, i have Database1 and database2, is it possible to make database connection to database2 by running stored procedure on database1. Thanks and Regards Situ
9
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example,...
5
rahulephp
by: rahulephp | last post by:
Hi there, can you please help me? i have data in array and i want to insert it in a single table. structure of table and array to be store is shown below: Please let me know how to store...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.