Jump to content

brad_mn1988

Members
  • Posts

    6
  • Joined

  • Last visited

brad_mn1988's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi,I want to use the Parent - Child feature for inline style code only.I cannot affect the header code whatsoever for this purpose, so inline is the only way I can accomplish what I want.With external CSS you can write: div table {background-color:red;} and it should (if I wrote the example correctly) set a table's background to red only if it is enclosed within a set of div tags.what if you wanted to use an inline CSS code? That is, if I started with this (inside HTML of course): <div style="???"><table><tr><td>Hello W3Schools</td></tr></table></div> How would I accomplish assigning the Child table's background-color to red by replacing the '???' with the right CSS?I know I could put in a style attribute directly in the table tag, but for complex reasons that would bore you, I can't. I need a one-shot inline CSS syntax to affect the immediate entity and any of it's Children tags... is that possible?Thanks in advance for any help. (PS: this is an extension of a reply I posted to a 'tables' topic here, but I was told that was 'hijacking', I apologize since I thought I was being polite by 'piggybacking' and not starting a whole new topic, and I thought 'hijacking' was taking a topic off of its intended course [like what a plane hijacker does] not extending the same course. But I could be wrong -- I guess it depends where 'piggybacking' ends and 'hijacking begins' -- Anyway, my apologies!)
  2. brad_mn1988

    tables

    Hi,I was about to post a queston about table attributes myself, but this thread answered most of them -- thanks!But I will append my unanswered questions here. But first a little background.I am building a PHP function that will return a table, I want the users to be able to determine many attributes of how it will render -- fonts, background colors etc. In the old days, each attribute would need a parameter. Now, with CSS, I have one parameter, $table_style, that gets passed in by the user (with a default setting). Because this dnynamically renders I need to use the 'inline' method for applying CSS (or course). CSS is much cleaner and extensible. thus the table gets rendered as so: <?phpecho "<table{$table_style}>"."(rest of table)"."</table>";?> My question is:I can't seem to get "child" attributes to work here in this 'inline' CSS method. Specifically, if I wanted to have my table where each row has a background color of red, I want to use the "child" status of the rows and embed the background color of the rows within the $table_style string.I tried (after PHP has parsed it): <table style="background-color:yellow; tr background-color:red">(rest of table)</table> and I expect the rows to have a background color of red, but they don't.(overall background color of yellow worked)Can someone explain what I am doing wrong?Thanks in advance!Brad
  3. Hi, I posted something like this b4. But I've gotten a little closer, so I hope someone will be able to get me the 'rest of the way'.So I put together a simple form and I wanted to make it bi-lingual. I can make the labels and fieldset english or spanish (using technique not shown) and then swapping out the english and spanish values of 'Click Here' and 'No Click Here' I can even make the buttons bi-lingual. ('Chasque Aquí' and 'Ningún Chasque Aquí') <form action="form_results.php" method="post" name="My SignOn" id="My SignOn"><fieldset><legend>My Logon</legend><p><label for="username">Username:</label><br /><input type="text" size="100" maxlength="100" name="username" id="username" tabindex="1" /></p><p><label for="password">Password:</label><br /><input type="password" size="100" maxlength="100" name="password" id="password" tabindex="2" /></p><button type="submit" name="submit" id="submit" value="submit1">Click Here</button><button type="submit" name="submit" id="submit" value="submit2">No Click Here</button></fieldset></form> In firefox this works great, since it is the 'value' attribute that gets passed(results received in FireFox): ["username"]=> string(13) "Test Username" ["password"]=> string(13) "Test Password" ["submit"]=> string(7) "submit1"Whether the button label was 'Click Here' or 'Chasque Aqui' the "Results" is "submit1".However, with IE, the exact same form renders this results(results received in Internet Exporere): ["username"]=> string(17) "Test Two Username" ["password"]=> string(17) "Test Two Password" ["submit"]=> string(13) "No Click Here"Notice two things:1. The result is the Text between the button tags, not the 'value' attribute of the tag. This is devastating to a PHP application that chooses an action based upon the returned "submit" value that attempts to be bi-lingual.2. Even though I meticulously clicked "Click Here" the form returned as if I actually clicked "No Click Here". So my questions are, how do I separate Button Text from returned Button "submit" value in IE, and how do I get the returned Button "submit" value to differentiate by which button is clicked in IE?Thanks in advance for any assistance -- even links to good sites/tutorials.
  4. Hi,Lots of people seem to have told you about writing scripts in PHP or ColdFusion or whatever, and as a PHP guy I fully support that you might want to take the next step and learn one of these tools.However, I think most people have forgottten that there is a plain-old HTML down and dirty method to do what you want.That is, allow a visitor to your site communicate with you without needing to have an email window 'pop-up' for that communication (it is a pain for the user, and often just doesn't work on public computers).You simply create your form in HTML as you already know how to do. (Usually, you would make your form approximate the look of an email composition window.) Then you make the action attribute of your form tag to be "mailto:myeamil@mydomain.com". Before I learned more than HTML I had many forms that would post this way, and then I created a simple parsing routine in a desktop rdbms. It works, not as elegantly as PHP, but it worked very well for a number of years as my workload prevented my HTML/PHP learning curve from being steeper.You also get the added advantage that you can put in a lot more attributes that you may want to collect with radio buttons, checkboxes and so on (often a comment will force the users to select a 'topic' from a finite list, and supply some basic demographics (gender; age range; income range). It comes to you in a somewhat ugly format, but it is also a logical format ("name=value" pairs, or is it "name:value" pairs, or?...).(caveat: I haven't done if for a while, so you might have to play with the syntax, but it is pretty close.)
  5. Hi,I had a site that I used a very simplistive version of MVC, where the main script reacted to the value of the 'button' attribute of a form. (I use PHP, but it renders HTML [XHTML hopefully] and my question is that.)But, I also wanted to use a translation technique where all the directions and labels and responses depend on the selected language.I was able to do this, but since the value of the button with the <input /> tag was what controlled my logic, I thought I was screwed. But then I found the <button></button> tags!If I had <input type="submit" value="Beer" /> I could change it to <button type="submit" value="Beer">Beer</button>, and no change, then when I swapped in <button type="submit" value="Beer">Cerveza</button> it worked just the same!...This is much more direct, much more intuitive, and separating the "value" of the button from it's "display" text seems more robust (akin to how <select><option> tags work).So I was thrilled, I could place serveral buttons out there and depend on the underlying value= to be rendered from the form, and change the "Label" of the button all I wanted. I could depend on the underlying value= to be the only value returned upon click where I had multiple buttons for multiple actions. I was thrilled and it was all working fabulously!...... in FireFox.Since I only use FireFox for most of what I do I was clobbered with reality when someone I was showing something to inadvertantly used IE instead of FireFox and all I had believed lay in shattered ruins.Since my users are finite, I could insist that they all use FireFox, but...Is there a "simple" way to proceed as I was? FireFox seems to handle the button tags and the value= returned and for the clicked button only effortlessly, is there a way to get IE to behave this way?I fear that the only answer is "messy workaround" and I know that is sadly the common answer with browser compatibility, but the <button> tags seemed to hold so much promise! I hope there is a way.Two Demos:Button Driven - works in FireFox, fails in IE:http://uscsd05.usc.edu/demos/form_render_table2.phpRadio Driven - rewritten from above to work with IE:http://uscsd05.usc.edu/demos/form_render_table.phpThanks in advance,Brad
  6. First post, so be gentle I have a great css block for a very cool scrolling table technique (http://cssplay.co.uk/menu/tablescroll.html) and part of the css is the width of the columns. So I have a php function to take db results and render a table, so I want to be able to dynamically render the css as I call this function so that column widths will be conmensurate with the data.(so why isn't this being posted on a php forum or among the css topics?)Well, it is because this is about the HTML of it all.Accoring to w3school tutorials and all, the <style> tags (where I can embed a bunch of css) belong within the <head> tags and can either be explicit or imported. However, if you are in the body, you need to use the style="" attibute at the tag level for css.It would make me feel terrible to place hundreds of "width" attributes in a table (althought I am sure it would work), so I was wondering whether I could just slap in a <style> block dynamically within the body.Well, it works.go here:http://www.w3schools.com/tags/tryit.asp?fi...e=tryhtml_styleand change the left pane to: <html><head><style>h1 {color: red}h3 {color: blue}</style></head><body><h1>This is header 1</h1><h3>This is header 3</h3><style>h1{color:purple}</style></body></html> and the h1 (even though the style tags appear after the usage) are is purple.Is this IE and FireFox being forgiving, or can I use a dynamic rendering of a <style> block to format the column widths of a particular table and depend upon it?ORIs it legal to have more than one <head> block? And if so should I have more than one <body> blocks and break "in and out" of these areas?like this:(this works, btw) <html><head><style>h1 {color: red}h3 {color: blue}</style></head><body><h1>This is header 1</h1><h3>This is header 3</h3></body><head><style>h1{color:purple}</style></head><body><h1>This is header 1</h1></body></html Thanks in advance!
×
×
  • Create New...