473,782 Members | 2,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DIV without line breaks


I'm strictly concerned with IE, so cross-browser compatibilty isn't
necessary. If you view the code below, I almost get exactly what I'm
looking for:
- A table of four cells that expands/contracts to the width of the
browser window. When it contracts, the cell never gets smaller (in
width) than the largest DIV item.
- When the DIV elements dynamically change, the table cells remain
the same in width (and as a result, the left positioning of the text
doesn't change on each dynamic DIV change).
But, here's my problem:

- The first DIV element appears on top, and the second appears below
when made visible (I'd like the top and left positioning of the
dynamic elements to appear in the same spot, based on where that is
per the table cell/browser window size.
- If I use absolute positioning, the table cell is still drawn larger
(in height) because it assumes the second line of the hidden DIV.
Although I've asked for a "DIV without line breaks" solution, now that
I think of it, that last bullet-point might still pose a problem.

Can anyone please help? I'd prefer to solve this through straight
HTML/CSS rather than some gimmicky JavaScript solution whereby I detect
the top-left attributes of items, then move the second DIV to that
location.

I apologize if I've done a poor job of explaining what I'm trying to
accomplish. Thanks in advance for any help you can offer me.

----------------------------------------------------------
<html>
<head>
<title>Header Work</title>
<script language="JavaS cript">
var incArray = new Array (0,0,0,0);
function sfs (num) {
var a = document.getEle mentById(num+"a ");
var b = document.getEle mentById(num+"b ");
if (incArray[num]%2==1) {
a.style.visibil ity = "hidden";
b.style.visibil ity = "visible";
} else {
b.style.visibil ity = "hidden";
a.style.visibil ity = "visible";
}
++incArray[num];
}
</script>

</head>

<body>

<table border=1 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td nowrap>
<div id="0a"
style="visibili ty:hidden;">xxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx </div>
<div id="0b" style="visibili ty:visible;">aa aaaaaa</div>
</td>
<td nowrap>
<div id="1a" style="visibili ty:hidden;">ccc ccccc</div>
<div id="1b" style="visibili ty:visible;">aa aa</div>
</td>
<td nowrap>
<div id="2a" style="visibili ty:hidden;">### #######</div>
<div id="2b" style="visibili ty:visible;">2</div>
</td>
<td nowrap>
<div id="3a" style="visibili ty:hidden;">cdc d</div>
<div id="3b"
style="visibili ty:visible;">aa aaaaaaawwwwwwww wwwwwwaaaa</div>
</td>
</tr>
</table>

<a href="javascrip t:sfs(0);">Swit ch 1st space</a><BR>
<a href="javascrip t:sfs(1);">Swit ch 2nd space</a><BR>
<a href="javascrip t:sfs(2);">Swit ch 3rd space</a><BR>
<a href="javascrip t:sfs(3);">Swit ch 4th space</a>
</body>
</html>
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316
View this thread: http://www.highdots.com/forums/showthread.php?t=1543511

Jul 24 '05 #1
11 12387
On Wed, 22 Jun 2005, Johnny Two Dogs wrote:
I'm strictly concerned with IE, so cross-browser compatibilty isn't
necessary.


So what on Earth are you doing here? This group is for authoring HTML
for the WWW.

Jul 24 '05 #2
Johnny Two Dogs wrote:
I'm strictly concerned with IE


Then perhaps you shouldn't be asking in a WWW authoring group.
Jul 24 '05 #3

I'm confused. Did I post to the wrong forum, or did you not like that
my primary concern is a working solution for Internet Explorer? If
it's the latter, please pretend that 1st sentence of mine never
existed. If it's the former, would someone please direct me to the
proper forum? Either way, a useful response would be fantastic.
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316
View this thread: http://www.highdots.com/forums/showthread.php?t=1543511

Jul 24 '05 #4
Previously in comp.infosystem s.www.authoring.html, Johnny Two Dogs
<Jo************ ********@no-mx.forums.yourd omain.com.au> said:
I'm confused. Did I post to the wrong forum, or did you not like that
my primary concern is a working solution for Internet Explorer?


Yes to the first, because of the second. This is a group for discussing
HTML authoring for the WWW. If you are only interested in a sub-section
of that (e.g. only one browser), then your question really isn't
appropriate for the group.

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 24 '05 #5

I just figured I'd spare people the difficulty of coming-up with a
cross-browser solution. Never mind. If there exists a solution that
works for all browsers, then that would obviously suit my needs even
better. Sheesh!

Again, if anyone knows a way to make it work (even if going about it a
different way than what I've coded thus far), your help would be
greatly appreciated. I'm not too keen on scripting the dynamic redraw,
since the finished product will contain form fields, and re-setting them
each time would require extra hassle.
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316
View this thread: http://www.highdots.com/forums/showthread.php?t=1543511

Jul 24 '05 #6
Dan
Johnny Two Dogs wrote:
I'm strictly concerned with IE, so cross-browser compatibilty isn't
necessary.


Why? Is this for an intranet rather than the World Wide Web? Even
there, the company that uses it might decide eventually to move its
users to a better browser.

--
Dan

Jul 24 '05 #7

I wish I had never written that 1st sentence in my original post. In my
experience, everything's easier to accomplish for IE. I was merely
trying to make things easier for whomever had a possible solution to
the problem at hand.

It's an Internet web application that currently has about 100 users,
but that number is steadily growing. While still small, we're able to
say "If stuff isn't displaying properly, go on and try running it
through IE." However, we obviously won't be able to do that forever.
Nevertheless, for that reason and several others, a
cross-browser-compatible solution would be great, but a lesser one (IE
only) would also suffice.
--
Johnny Two Dogs
------------------------------------------------------------------------
Johnny Two Dogs's Profile: http://www.highdots.com/forums/member.php?userid=316
View this thread: http://www.highdots.com/forums/showthread.php?t=1543511

Jul 24 '05 #8
Johnny Two Dogs wrote:
I'm strictly concerned with IE, so cross-browser compatibilty isn't
necessary. If you view the code below, I almost get exactly what I'm
looking for:

About the only way to accomplish what you want is with
position:absolu te for both DIVs in each table cell. IE has severe issues
with absolute positioning. It will work for simple layouts but get tricky
(like yours) and object placement will look very creative, and not what
you expect.
<aside>
People here generally do not like IE because it is so far behind
current technology. It was trailing edge stuff in 2000, just good enough
to drive Netscape Navigator out.
Since then MS has done next to nothing to fix the layout defects IE so
proudly displays. MS has even publicly stated it thinks CSS is flawed and
only grudgingly provided what it thought might be useful.
AKAIK few, if any, of those defects were addressed in the hundreds of
patches issued, mostly to fix security holes.
So those who want a world where standards are respected find it irksome
when someone chooses to frivolously ignore standards. Writing compliant
CSS+HTML is easier than a table-driven "tag soup" approach, and is a lot
easier to maintain. IE complicates this by not being compliant ("Ah! Now
that my site works in standards compliant browsers, I must spend time
working around the IE faults.").
</aside>

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 24 '05 #9
While IE is still the dominant browser, it has been losing market
share steadily for more than two years. Unless you want to promote
your Web application to an ever declining audience or you want to
go through the expense and bother of redoing it later, you should
make it compliant with the W3C specifications from the beginning.

--

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

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 24 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3291
by: dan glenn | last post by:
Hi. I'm finding that if I have text entered into a <textarea ...> </textarea> in a form, and that text has leading blank lines (with no spaces or anything else), that when I retrieve the entered text, I lose the leading blank line. Each time it goes through a post any top-leading blank line is lost. Only one- if I have several blank lines in a row at the top, only the first is lost. (If the top blank line has a single space, it's handled...
1
2668
by: Bill | last post by:
I am downloading data from a website that displays it in a table $fp = fopen("a website page", 'r'); The following accesses the stream one <td> element at a time $myData = fgets($fp); Then I select the $myData that I want and add them to a string, $str1 while(condition){ $str1 = $str1.$myData; $myData = fgets($fp);
4
22771
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary to export the report? I tried exporting a report by using the .rtf rich-text format (the plain-text format was the only other word-processing option listed when exporting). I then opened the .rtf file in Word. However, it looks like some...
10
12325
by: Evie | last post by:
I understand that when a switch statement is used without breaks, the code continues executing even after a matching case is found. Why, though, are subsequent cases not evaluated? I wrote a program to demonstrate how a switch without breaks behaves vs. how I expected it to behave. The code includes: (1) a switch statement with breaks (2) the if/else statements that have the same results as (1) (3) a switch statement without breaks...
5
16852
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the line breaks with <br /> tags ( using the php function nl2br() ), and <br /> tags showed up in the textarea.
2
26442
by: caspardh | last post by:
i was trying to code a morse code decipherer which workd fine except that the .txt file that i was converting had linebreaks built in, i cant get python to ignore the line breaks and i cant find any characters for line breaks to remove them using the string.replace() function if anybody know the syntax for a line break or the ASCII characters that can be used for line breaks to replace/remove them that would be great or if anybody know how...
8
2498
by: Harris Kosmidis | last post by:
It seems I cannot understand CSS, well. I have donw the following page: http://www.pennias.gr/home.php It's in greek but the context is of no importance. I used a big table to put in my page beacuse I couldn't find another way to make horizontal div that will be with margin- =0 and look well both in IE and FF.
1
1945
by: =?ISO-8859-1?Q?thib=B4?= | last post by:
Hi, Taking a closer look to highlight_file() lastly, I found out that its line break policy was a bit.. strange. <?php # highlight_file() line breaks test $f = fopen('highlight_file_test', 'w'); fwrite($f, highlight_file(__FILE__, true)); fclose($f); ?>
10
1769
by: Anze | last post by:
Hmmm... anyone? :) Anze Anze wrote:
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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,...
1
10076
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
9939
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
7486
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
5375
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
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.