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

equiv of border=1 in table

P: n/a
Hi All

Wondered if you could let me know if I've missed something when setting up a
table.

If I use the following:

<TABLE WIDTH=500 BORDER=1>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

All 4 sides of all of 4 table cells have a border 1 pixel in depth -
perfect!

If I change this to:

<TABLE WIDTH=500 STYLE="border: 1px dashed black">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

I only get a border on the outer 'wall' of the table - no borders on the
cells!!!

Due to the project I'm working on, I'm dynamically creating rows and cols in
DOM, I'd really like to just specify that all of the cols/rows have a border
in one go like the old table method rather than having to define the border
style for each cell.

I can't use the old table method of BORDER=1 because I need the dashed style
rather than a solid border. Any ideas on how I can do this?

Thanks

Sep 4 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Yobbo wrote on 04 sep 2006 in comp.lang.javascript:
Hi All

Wondered if you could let me know if I've missed something when
setting up a table.

If I use the following:

<TABLE WIDTH=500 BORDER=1>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

All 4 sides of all of 4 table cells have a border 1 pixel in depth -
perfect!

If I change this to:

<TABLE WIDTH=500 STYLE="border: 1px dashed black">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

I only get a border on the outer 'wall' of the table - no borders on
the cells!!!

Due to the project I'm working on, I'm dynamically creating rows and
cols in DOM, I'd really like to just specify that all of the cols/rows
have a border in one go like the old table method rather than having
to define the border style for each cell.

I can't use the old table method of BORDER=1 because I need the dashed
style rather than a solid border. Any ideas on how I can do this?
I sympathize with your problem.

However I fail to see what it has to do with Javascript.

Perhaps a CSS NG could answer your question,
please follow up over there.

Or look here:
<http://www.thescripts.com/forum/thread99548.html>
?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 4 '06 #2

P: n/a
JRS: In article <12*************@corp.supernews.com>, dated Mon, 4 Sep
2006 22:32:57 remote, seen in news:comp.lang.javascript, Yobbo
<me@nospam.composted :
>If I change this to:

<TABLE WIDTH=500 STYLE="border: 1px dashed black">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

I only get a border on the outer 'wall' of the table - no borders on the
cells!!!

Due to the project I'm working on, I'm dynamically creating rows and cols in
DOM, I'd really like to just specify that all of the cols/rows have a border
in one go like the old table method rather than having to define the border
style for each cell.
See what this does :-

<style type="text/css"td { border: 3px solid red" } </style>

<TABLE WIDTH=500 border=0 STYLE="border: 5px dashed blue">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>
..
--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Sep 5 '06 #3

P: n/a
Dr John Stockton wrote on 05 sep 2006 in comp.lang.javascript:
See what this does :-

<style type="text/css"td { border: 3px solid red" } </style>

<TABLE WIDTH=500 border=0 STYLE="border: 5px dashed blue">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>
Try this with and without border-collapse:

<style type="text/css">
table {
border:2px dashed blue;
border-collapse:collapse;
width:500px;}
td {
border:2px solid red;}
</style>

<table>
<tr><td>fred<td>fred
<tr><td>fred<td>fred
<tr><td>fred<td>fred
<tr><td>fred<td>fred
</table>

[I don't use </tr></tdanymore]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 5 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.