By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,826 Members | 815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,826 IT Pros & Developers. It's quick & easy.

How to increase vertical spacing of items within a <TD>?

P: n/a

First, I'm glad to find a newsgroup that still uses a FAQ:
http://www.htmlhelp.com/faq

The challenge:

These checkboxes (inside a table data TD tag) came out too squeezed
together (vertically) so I tried to double-space them with the CSS
"line-height" parameter. That did not work (at least for the IE
browser), so I put an extra break (BR) tag inside the TD and it works
great, but now it's a little TOO spacey.

Any ideas?
<tr>
<td>Please specify:</td>
<td>
<!-- span "line-height:1.5em;" -->
<br /><input type="checkbox" name="ckwheelc" wheelchair access<br
/><br />
<input type="checkbox" name="cksmoking" smoking allowed<br /><br />
<input type="checkbox" name="ckwc" restroom available<br />
<input type="checkbox" name="cksteps" heated area<br /><br />
<small><i>If other, you can describe it below:</i></small>
<!-- /span -->
</td>
</tr>
....or would you purists not stack things in a <TDlike this?

-------------------------

Also, thanks for posting http://css.maxdesign.com.au/listamatic/ ! A
wealth of clean HTML/CSS solutions. Very cool.

I am concerned that some of you turn JavaScript off because I use it
to verify what the user typed into form fields (to make sure there
aren't too many characters, that the email address entered looks like
an e-mail address, etc.) The only other way I can think of to verify
is to send the form back to the server. I like the idea of doing it on
the client. What method do you all favor for verification of form
answers?

Jan 10 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
wo************@hotmail.com wrote [in part]:
First, I'm glad to find a newsgroup that still uses a FAQ:
http://www.htmlhelp.com/faq

The challenge:

These checkboxes (inside a table data TD tag) came out too squeezed
together (vertically) so I tried to double-space them with the CSS
"line-height" parameter. That did not work (at least for the IE
browser), so I put an extra break (BR) tag inside the TD and it works
great, but now it's a little TOO spacey.

Any ideas?
<tr>
<td>Please specify:</td>
<td>
<!-- span "line-height:1.5em;" -->
<br /><input type="checkbox" name="ckwheelc" wheelchair access<br
/><br />
<input type="checkbox" name="cksmoking" smoking allowed<br /><br />
<input type="checkbox" name="ckwc" restroom available<br />
<input type="checkbox" name="cksteps" heated area<br /><br />
<small><i>If other, you can describe it below:</i></small>
<!-- /span -->
</td>
</tr>
...or would you purists not stack things in a <TDlike this?
Instead of using <tableand <br>, use paragraphs. The checkboxes can
be in paragraphs with class ckbox:
p.ckbox { text-indent: 10em; margin-top: 0.5em }

Vary the indentation and margin until it looks the way you want it.

--

David E. Ross
<http://www.rossde.com/>

Concerned about someone (e.g., Pres. Bush) snooping
into your E-mail? Use PGP.
See my <http://www.rossde.com/PGP/>
Jan 10 '07 #2

P: n/a
Gazing into my crystal ball I observed wo************@hotmail.com writing
in news:11**********************@p59g2000hsd.googlegr oups.com:
I am concerned that some of you turn JavaScript off because I use it
to verify what the user typed into form fields (to make sure there
aren't too many characters, that the email address entered looks like
an e-mail address, etc.) The only other way I can think of to verify
is to send the form back to the server. I like the idea of doing it on
the client. What method do you all favor for verification of form
answers?

Nothing wrong with client side javascript - I think it's a nice thing to do
for the user. But, just make sure that everything is validated server side
as well.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jan 10 '07 #3

P: n/a
Scripsit wo************@hotmail.com:
First, I'm glad to find a newsgroup that still uses a FAQ:
http://www.htmlhelp.com/faq
The group that would have been the right one for your primary question,
c.i.w.a.stylesheets, has a FAQ, too. Actually, two.
These checkboxes (inside a table data TD tag) came out too squeezed
together (vertically) so I tried to double-space them with the CSS
"line-height" parameter. That did not work
You didn't post a URL. Going thru the trouble of constructing a test page
from you sketchy code snippet, I noticed that setting line-height works just
fine. You might, however, have a different impression if you only set
line-height to 1.5em, which is not that much larger than the typical
defaults (about 1.2em to 1.3em). But this _is_ a CSS issue, not HTML.
so I put an extra break (BR) tag inside the TD and it works
great, but now it's a little TOO spacey.
You're just creating trouble that way. How many times can you break a line?
(<brmeans "line break") Some browsers think that <br><brshould create an
empty line, but that's really debatable, to put it mildly. So your HTML
approach is wrong; use CSS for styling.
<input type="checkbox" name="ckwheelc" wheelchair access
ObHTML: For accessibility, you should use <labelmarkup, e.g.

<input type="checkbox" name="ckwheelc" id="ckwheelc">
<label for="ckwheelc">wheelchair access</label>

(See "Accessibility issues of checkboxes and radio buttons",
http://www.cs.tut.fi/~jkorpela/forms/kbd.html )
I am concerned that some of you turn JavaScript off
I'm more worried about people who don't do that and might not even know how
to do that.
because I use it
to verify what the user typed into form fields (to make sure there
aren't too many characters, that the email address entered looks like
an e-mail address, etc.)
As a side note, most e-mail address verification checks reject well-formed
addresses and accept addresses that violate the e-mail address format
standard.
The only other way I can think of to verify
is to send the form back to the server.
You mean you haven't implemented such checks first? Then sit back and wait
for the first joker to submit a gigabyte of junk, using a slightly modified
copy of your page. If you're unlucky, it won't be a joker but a cracker who
submits it in a loop.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jan 10 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.