473,508 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

resizing td element under mozilla

i want to resize dynamically table cols.
But some strange behaviour occurs under mozilla.
I cannot resize a col smaller than the largest element, even with overflow
hidden and table-layout fixed.
With one exception:
Inserting a initial css table-width like 10px in the html. In this case i
can resize to smaller sizes.
I can live with that (need to calc all td widths, set each and then put the
table to 1px),
but why can't i add this table width dynamically after rendering, to allow
shrinking?
I don't want to modify the html/css, as it comes from an other engine. Just
Javascript DOM.

Does anybody knows a hint, how to resize all tables in the way of the first
example without any hardcoded HTML-CSS.
Allowing shrink to zero under mozilla ?

the example:
***************************************
<head>
<style>td{ overflow:hidden}</style>

<script>
function mod(ob, siz){
var tab = document.getElementById(ob);
tab.style.tableLayout = "fixed";
tab.style.width = "1px"; // does not work in mozilla
var tds = tab.getElementsByTagName("TD"); //just to simplify the example
tds[0].style.width= siz+"px";
tds[0].style.color="red";
tds[1].style.width= "50px";
tds[1].style.color="blue";
}
</script>
</head>
<body>
<br />
first example this way it should be: <a
href='javascript:mod("t1",10);'>10px</a>&nbsp;<a
href='javascript:mod("t1",200);'>200px</a><br />
<table id='t1' style='width:20px;table-layout:fixed; '
border='1'><tr><td>massabombassa</td><td>massabombassa</td></tr><tr><td>mass
abombassa</td><td>massabombassa</td></tr></table>

<br />second example only larger works: <a
href='javascript:mod("t2",10);'>10px</a>&nbsp;<a
href='javascript:mod("t2",200);'>200px</a><br />
<table id='t2' style='table-layout:fixed;'
border='1'><tr><td>massabombassa</td><td>massabombassa</td></tr><tr><td>mass
abombassa</td><td>massabombassa</td></tr></table>

<br />any unknown table: <a href='javascript:mod("t3",10);'>10px</a>&nbsp;<a
href='javascript:mod("t3",200);'>200px</a><br />
<table id='t3'
border='1'><tr><td>massabombassa</td><td>massabombassa</td></tr><tr><td>mass
abombassa</td><td>massabombassa</td></tr></table>
</body>


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #1
4 2890
andres obrero wrote:
i want to resize dynamically table cols.
But some strange behaviour occurs under mozilla.
I cannot resize a col smaller than the largest element, even with overflow
hidden and table-layout fixed.
[...]
the example:
***************************************
<head>
<style>td{ overflow:hidden}</style>

<script>
[...]


<http://validator.w3.org/>
PointedEars
Jul 23 '05 #2
yeah,
very helpful to understand the skills of how to communicate without saying
nothing,
but does not lead to any solution of my problem.
as the validator just want a few headers more.

[[[

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang='de'>
<head>
<title></title>
<style type="text/css" >
td{ overflow:hidden}
</style>

<script type="text/javascript" >

]]]
maybe it helps to read my question a bit more carefully.

"Thomas 'PointedEars' Lahn" <Po*********@nurfuerspam.de> schrieb im
Newsbeitrag news:41**************@PointedEars.de...
andres obrero wrote:
i want to resize dynamically table cols.
But some strange behaviour occurs under mozilla.
I cannot resize a col smaller than the largest element, even with overflow hidden and table-layout fixed.
[...]
the example:
***************************************
<head>
<style>td{ overflow:hidden}</style>

<script>
[...]


<http://validator.w3.org/>
PointedEars



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #3
andres obrero wrote:
very helpful to understand the skills of how to
communicate without saying nothing,
You just did not understand.
but does not lead to any solution of my problem.
as the validator just want a few headers more.
These are not headers, they are markup declarations and attributes
as parts of Valid (X)HTML.
[[[
What is this supposed to mean?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
Unlikely. You are using <br /> which is XHTML Syntax.
[...]
At least this part is Valid now.
]]]
maybe it helps to read my question a bit more carefully.
Maybe it helps to learn what you are using ...
[Top post]


.... and stop that, see the FAQ (for both).
PointedEars
Jul 23 '05 #4
DU
andres obrero wrote:
i want to resize dynamically table cols.
But some strange behaviour occurs under mozilla.
I cannot resize a col smaller than the largest element, even with overflow
hidden and table-layout fixed.
If I was an user, I would expect or even demand that a browser never
collapse cells or columns up to a point that I can not have access to
its content. That expectation should also meets the web author's own
expectation too: let the content be reached, viewed, accessed by the user.
CSS declaration table-layout: fixed have pretty much nothing to do here,
unless you are willing to define width for each column. And in the code
you provided, you did not.
With one exception:
Inserting a initial css table-width like 10px in the html. In this case i
can resize to smaller sizes.
I can live with that (need to calc all td widths, set each and then put the
table to 1px),
but why can't i add this table width dynamically after rendering, to allow
shrinking?
I don't want to modify the html/css, as it comes from an other engine. Just
Javascript DOM.

For someone outside of your webpage design thinking, reasoning, and not
knowing exactly your webpage requirements, analysis, etc.., it's a bit
difficult to follow your line of thinking here.
Does anybody knows a hint, how to resize all tables in the way of the first
example without any hardcoded HTML-CSS.
Allowing shrink to zero under mozilla ?

Again, what you're trying to achieve here goes against normal,
reasonable behavior of a web page.
the example:
***************************************
<head>
It would be much more preferable, convenient and useful for readers of
your post willing to offer assistance, suggestions, insight if you could
upload your example and provide an url. It would also be quite useful to
make such document with valid/validated markup and css code, you know.
<style>td{ overflow:hidden}</style>

<script>
function mod(ob, siz){
var tab = document.getElementById(ob);
tab.style.tableLayout = "fixed";
table-layout: fixed is aimed at parsing and rendering a table and such
declaration has requirements, otherwise the table is rendered with the
slow approach. So, here, I think your assignment is pointless.
tab.style.width = "1px"; // does not work in mozilla
Well, how or why should a whole table as wide as 1px would achieve
something?
var tds = tab.getElementsByTagName("TD"); //just to simplify the example
tds[0].style.width= siz+"px";
tds[0].style.color="red";
tds[1].style.width= "50px";


Just forget about browsers here. How should a human (or a genius,
whatever) comply with your table width and cell widths
demands/requirements here? I'm not even asking what you're trying to do
here; I'm asking how could anyone be able to achieve what you are
requesting here. The whole table should be 1px wide but some of its
table cells should be 50px wide.

[snipped code]

If you want meaningful help, assistance, then the best policy to adopt,
to adhere to is to post the most helpful, most meaningful, useful post
you can provide about your webpage situation. If you want respect, be
respectful and be respectable yourself. If you want a friend, act like
one. etc,etc.

Why we won't help you
"(...) Guru Designer replies, telling Newbie Designer that their page
doesn’t validate, and that they should go validate their page before
asking such questions. There is no further discussion; no further
replies are posted; no one else is willing to help.(...)"
http://diveintomark.org/archives/200..._wont_help_you

DU
Jul 23 '05 #5

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

Similar topics

14
21494
by: delerious | last post by:
I need to determine an element's width and height in pixels (not including padding, border, and margin) in Javascript. The element will not have width or height styles specified. In Mozilla, I...
4
15758
by: Kona | last post by:
Hello I've created a style for a div that is set to a specific height. My question is that if the content in this div is larger will it resize to fit the new content? Thank you Kona
86
7679
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
5
2624
by: Robert J. O'Hara | last post by:
For some time I've made use of the max-width property in CSS to cause my pages to appear as a centered block against a contrasting background. This works well in new browsers (Mozilla, etc.) and...
2
3353
by: z | last post by:
Hi, i just wanted to know how i can resize a table using javascript but in this special manner: I have two tables, one at the top of the page and the other below that one. The problem is that in...
6
13334
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... ...
4
2534
by: enceladus311 | last post by:
I've read through a number of links that discuss various methods of resizing a div; however, nothing seems to work correctly for me. The basic idea is that I would like to implement is a panel...
13
4377
by: bgraphics2031 | last post by:
I'm trying to get this iframe to dynamically resize by dragging a vertical bar, but it's not working in Mozilla (It originally worked in IE but I've been trying to port it over). Any help will be...
9
5271
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
0
7223
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,...
0
7115
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...
1
7036
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...
0
7489
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...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
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...
0
4705
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...
0
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.