html

Finding the Width of Tables or Cells

How do I find the width of a table or columns in a table without specifying it in HTML or Javascript? For example: <table id="myTable"> <tr><td>column a</td><td>column b</td></tr> </table> In Javascript: var tbl = document.getElementByID("myTable"); alert(tbl.style.width); //will be undefined ...

CSS Question

I have this <p> <cite>One</cite><cite>Two</cite> </p> is there a way in css to say that the first cite is going to be bold and the second italics, without editing the above code? ...

Forms - Can they be done without tables?

I've gotten used to using <table>s for aligning my form fields perfectly. This is how I commonly write my forms: <table border="0"> <tr> <td><label for="f_name">First name:</label></td> <td><input type='text' id='f_name' name='f_name' /></td> <td class='error'><?=form_error('f_name');?></td> </tr> </table> I know ...

CSS: Cascade just one level

Say i have a <table> with a css class defined (<table class="x">) and i want to change the 'color' property of just the first level of <td>, is this possible using css without setting classes on the relevant <td>? I.e. <table class="x"><tr><td> xxxx <table><tr><td>yyy</td><tr></table> </td></tr><table> I only want the xxxx to ch...

Under what cirumstances would I need eruby if I'm just doing Ruby programming

As I understand it, eruby is like erb - it lets you stick ruby code into HTML. If someone is using Rails, more than likely they would use erb or Haml. But if I'm not using Rails, under what cirumstances would I need eruby if I'm just doing Ruby programming? I guess I don't understand why someone would need to be outputting HTML if th...

under what type to write javascript in html pages

What type should I use (If at all) in a javascript block inside html? application/x-javascript text/javascript something/other... ...

HTML Radio buttons styled as Toggle Buttons

Instead of having the typical disks with labels to the right, I want the options to be presented as clickable buttons. The selected option should appear to be pushed or pressed in. I want to do this in HTML, but an example of this are the top left buttons in the program Audacity where you select the cursor/tool mode. What's the best w...

AJAX innerHTML. Change links. Possibly a " or ' problem.

What I want is a hyperlink More when clicked on runs some javascript function and also changes to a hyperlink Less. Heres what I have which doesnt work. It runs the ajaxpage function fine but not moreToLess. I think its my use of " and ' in the javascript. <script type="text/javascript"> function moreToLess(){ document.getElementById('...

How to have elements with different background-colors yet the background-image shows everywhere (aka, a watermark)?

I want to create an html page with a watermark. I set the background-image on the body. However I have some elements that are not allowing the background image to bleed through. They define their own background-color (but not background-image), overriding the color in the body. This surprised me. They didn't override the image, just...

Different output for IE and the rest

For some reason this class outputs ok in IE but in Firefox the words and the lines ( | ) are not centered: .horz_list li{ display: inline; background-color: #CEE3F8; border-right-style:thin; padding-right: 4px; padding-left: 4px; } This is the page for the output: <div id="top_nav"> <ul c...

<div> layer on top of PDF.

So, the problem I face is like this: I have a layer, which it will be placed on top of a pdf on the page. The PDF is either using to embed, or iframe to include it. However, CSS style doesn't apply on PDF (because it is a plug-in? ). Therefore, even I put z-index:1000 for the , that layer still goes behind the PDF. any idea how to fix ...

How do I set the background color of an HTML Frame?

I have a legacy website using frames. The pages within the frame do not use a white background and hence, I get an annoying "white flash" while the pages in the frames transition. I think this can be fixed by changing the background color of the <frame>, but no matter what is entered, Internet Explorer will NOT see anything but white. ...

How do I properly sanitize data received from a text area, when outputting it back into the text area?

A user will input text in a textarea. It is then inserted directly into a mySQL database. I use trim, htmlentities, mysql_real_escape_string on it and I have magic quotes enabled. How should I sanitize it when outputting that data back into a textarea? Thanks for your help. I've never been too sure on the correct way of doing this... ...

How can I create an element that flips between two values on click?

Given two spans like this: <span>Click for info</span> <span style="display: none">Here is a big long string of info blah blah</span> ...I'd like to have an onclick function attached to each so that the visitor sees "Click for info", and then when they click it, the first span is hidden and the second is unhidden. And, of course, when...

Fix height of a table row in HTML Table

Kindly look at the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> </head> <body> <table id="content" height="525" border="0" cellspacing="0" cellpadding="0"> <tr style="height:9px"><td heig...

Diplaying a list of object data on an HTML page

Hi, I've been working on a web application that requires the user to input certain request data. Once this data has been captured it will be displayed in the form of a grid with only the main content of the data displayed while the rest of the content will only be displayed once the user clicks on the main content. At the moment i'm dis...

Are There Any Plugins to HTML Encode Text in the VS Text Editor?

This may be a simple question since it seems such an obvious tool for any web dev.. I currently use a free web-based thing when I need to encode strings, but I was curious to know if anyone knows of a plugin for VS that will allow you to HTML encode text in the Text Editor? ...

How do I display a table of data when a user hovers over another table's cell?

Hi, I need to generate a table from a list of objects. Each row will contain only the basic information for each object. However when the user hovers over a specific cell I want a popup, that contains all the information for that particular object, to appear. Maybe the popup should be in the form of a table with all the details of some ...

What doesn't checkbox value = '1' work in this case?

I've been reading up on stackoverflow about checkboxes and setting their value to 1 to make them checked, but it doesn't seem to work in my case. I have a databinder eval expression that evaluates to 1 when my checkbox should be checkeed, and I've verified the generated page has at least one input checkbox with value=1 that is not displa...

Hide border on table where no cell exists in Firefox and border-collapse: collapse;

Given the following HTML page a horizontal line appears at the top of the table where the 1st row would have a 2nd and 3rd cell (if they were defined). <html> <head> <Title>Test Page</Title> <style type="text/css"> table { margin:10px 0 10px 0; padding:0; margin: 0 0 0 0; border-collapse: collapse; border: 0; } td...