Reply LinkBack Thread Tools Search this Thread
Old 05-06-2007, 16:14   #1 (permalink)
babydutka
what sarah said
 
babydutka's Avatar
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 204
Send a message via AIM to babydutka
Text-transform all uppercase to regular capitalization

With text-transform you can get the text to go all uppercase, all lowercase or capitalized.

Capitalize makes sure that the first letter is capitalized on each word but is it possible to transform an all Uppercase set of text to Capitalized (i.e. first letter capitalized with the rest lowercase?)

Thanks!
  Reply With Quote
Old 05-06-2007, 18:42   #2 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,126
If you had this: <p>HELLO, HOW ARE YOU, WHAT'S HAPPENING?</p>

and threw this CSS at it: p {text-transform:capitalize;}

...it should become capitalized (first letter is uppercase, rest aren't). You're saying this isn't the case?
  Reply With Quote
Old 05-06-2007, 21:25   #3 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Maybe try a descendant selector scheme.

<div>
<p>SOME TEXT</p>
</div>

div { text-transform: lowercase; }
div p { text-transform: capitalize; }
  Reply With Quote
Old 06-06-2007, 11:19   #4 (permalink)
babydutka
what sarah said
 
babydutka's Avatar
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 204
Send a message via AIM to babydutka
Hmmm nope neither of those worked....

herk - you would think that the capitalize would do that but it's not....

pgo - thought that would work. But didn't seem to do anything.

Thanks for the thoughts!
  Reply With Quote
Old 06-06-2007, 11:23   #5 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Why can't you change the text itself?
  Reply With Quote
Old 06-06-2007, 11:51   #6 (permalink)
SMILEdotCROSS
//||//||//||//||//||//||/
 
SMILEdotCROSS's Avatar
 
Join Date: Apr 2007
Location: Currently UK
Posts: 326
__________________
Americans don't understand sarcasm.
  Reply With Quote
Old 07-06-2007, 10:55   #7 (permalink)
babydutka
what sarah said
 
babydutka's Avatar
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 204
Send a message via AIM to babydutka
Quote:
Originally Posted by pgo
Why can't you change the text itself?

It's monthly data that I receive from the client for stats on their sales reps and there are almost 200 names so I'd need to manually change those each month.... just wondering if there was a CSS solution. Not a huge deal though - all Caps works too! haha
  Reply With Quote
Old 07-06-2007, 11:13   #8 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,968
How are you bringing in or storing the data?
Would it not be possible to transform the names at the point of entry (as they are added to the storage file or db)?
Alternatively, if you're using a server-side language to loop through the names when creating the surrounding markup, it's a simple thing to convert them into the appropriate casing.

Better, imho, to get certain data in the right casing at storage level, rather than needing to fiddle about with it during the page view.


The (potential) issue with using CSS is that, whilst it is presented correctly, the underlying text isn't really transformed. If you selected and copied CSS text-transformed text, the copied text would still be in its actual/natural casing, not that set by the CSS. Similarly, if you're manipulating it via the DOM, the casing will still be that of how it appears without CSS.
Neither is a deal breaker. It's just more to have to bear in mind.
  Reply With Quote
Old 07-06-2007, 12:31   #9 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,126
Quote:
Originally Posted by babydutka
It's monthly data that I receive from the client for stats on their sales reps and there are almost 200 names so I'd need to manually change those each month.... just wondering if there was a CSS solution. Not a huge deal though - all Caps works too! haha
How about copying the text into Word, then utilize the Format > Change Case tool, then paste it into your site's code?
  Reply With Quote
Old 07-06-2007, 13:10   #10 (permalink)
babydutka
what sarah said
 
babydutka's Avatar
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 204
Send a message via AIM to babydutka
Quote:
Originally Posted by Bill Posters
How are you bringing in or storing the data?
Would it not be possible to transform the names at the point of entry (as they are added to the storage file or db)?
Alternatively, if you're using a server-side language to loop through the names when creating the surrounding markup, it's a simple thing to convert them into the appropriate casing.

Better, imho, to get certain data in the right casing at storage level, rather than needing to fiddle about with it during the page view.


The (potential) issue with using CSS is that, whilst it is presented correctly, the underlying text isn't really transformed. If you selected and copied CSS text-transformed text, the copied text would still be in its actual/natural casing, not that set by the CSS. Similarly, if you're manipulating it via the DOM, the casing will still be that of how it appears without CSS.
Neither is a deal breaker. It's just more to have to bear in mind.

Some good thoughts Bill. Thanks! The data is being copied in from Excel which has been dumped from a Access Database. We had originally proposed to put all the data into a MySQL database, but the client didn't have the budget to do that so I'm just doing a quick Copy and Paste of the tables. I'll look into using PHP to do the trick. If it takes a lot of time each month it's not fitting budget wise...

Thanks!
  Reply With Quote
Old 07-06-2007, 13:11   #11 (permalink)
babydutka
what sarah said
 
babydutka's Avatar
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 204
Send a message via AIM to babydutka
Quote:
Originally Posted by herkalees
How about copying the text into Word, then utilize the Format > Change Case tool, then paste it into your site's code?

Thats a good thought too As I mentioned to Bill, if it's going to take a bunch of work each month, it's not budget friendly...

Thanks though!
  Reply With Quote
Old 07-06-2007, 14:24   #12 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,968
Quote:
Originally Posted by babydutka
Some good thoughts Bill. Thanks! The data is being copied in from Excel which has been dumped from a Access Database. We had originally proposed to put all the data into a MySQL database, but the client didn't have the budget to do that so I'm just doing a quick Copy and Paste of the tables. I'll look into using PHP to do the trick. If it takes a lot of time each month it's not fitting budget wise...

Thanks!
A cheap and cheerful alternative would be to use a text file as a db, which in its simplest form can be just a text file with a name on each line.

The PHP is relatively simple.
At the data entry end, it wouldn't be too hard to set up a page with a form (w/ textarea) into which you could paste the names after you'd copied them Excel. The form could then be submitted and the output could be used to generate a formatted, case-corrected text file containing the names.
At the other end, PHP could be used to pull in the names from that file and insert them into your markup however you choose.

Something to consider.
  Reply With Quote
Old 08-06-2007, 08:44   #13 (permalink)
babydutka
what sarah said
 
babydutka's Avatar
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 204
Send a message via AIM to babydutka
Hmm very creative and interesting solution... Thanks Bill Posters!
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8