473,607 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

equiv of border=1 in table

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
3 1433
Yobbo wrote on 04 sep 2006 in comp.lang.javas cript:
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.htm l>
?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 4 '06 #2
JRS: In article <12************ *@corp.supernew s.com>, dated Mon, 4 Sep
2006 22:32:57 remote, seen in news:comp.lang. javascript, Yobbo
<me@nospam.comp osted :
>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.c om/faq/>? JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Sep 5 '06 #3
Dr John Stockton wrote on 05 sep 2006 in comp.lang.javas cript:
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:collap se;
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
18906
by: Marek Mänd | last post by:
When using <TABLE rules="all"> Mozilla 1.6 and previous versions draw a nasty interiour border, which doesnt go away though I have on TD's css border:none set. Is it something wrong with my stylehseet or is it a bug of mozilla? I am asking this because of IE and Opera work differently here. <style>
5
14774
by: Rolf Brauser | last post by:
Hi, I want to have a table with a border of 1px arround it but table="1" is more than a pixel because this 3d effect is attached. Values below are not accepted How can I get this border with 1px can someone give me any hints ? thanks for any help
3
1068
by: ireneatngs | last post by:
Hi, I have example html below which contains a couple of hidden divs. However, some of the table borders within these hidden divs are actually displayed when they should not be. In my example, I have comments indicating that if I remove the 'border-collapse' attribute for two of the tables within the hidden divs, my problem is fixed.
23
52115
by: Bob Bedford | last post by:
I've a table. The table must not have any border. The TR (every line) must have a border, but not the lines between cells. The TR.pages must have no border. so .mytable{border:0px;} ..mytable tr{border:1px solid #000000;} ..mytable th{border:0px;}
3
58246
by: effendi | last post by:
Hi Can any tell me what is the javascript equivalent of CSS border? I would like to change the border of my cell when it is set on focus. I have tried onFocus="style.border='3px'" but it is not working. Thanks
3
1990
by: Bill Endow | last post by:
I've noticed that the WebControl.Table class always outputs the attribute "border="0"", and I cannot stop it from doing so, no matter what I try. I end up with generated HTML that looks like: <table border="1" border="0"> For example, create a new server control that inherits from System.Web.UI.Control, and call it CustomTable. Add an event handler for the Load event: Protected Sub CustomTable_Load(ByVal sender As Object, ByVal e As...
8
12088
by: UJ | last post by:
I have a table with multiple cells and I want to draw a box around the entire table but not around the individual cells. How do I do that? TIA - Jeff.
3
4008
by: Yobbo | last post by:
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>
2
7692
ramprabu
by: ramprabu | last post by:
Hello, I will give the sample code of html. Here first table only apply border 1 width. other tables are border 0. The problem is border=0 means border was not visible but it takes white border space. I want to remove this space. How can I solve? <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server">
0
7985
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8322
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5997
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3953
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4013
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.