473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Resizing table depending on the windows size

i have three rows on my main site
i want that the middle-row resizes (only height) depending on the windows
size
i know it is possible in javascript, but i dont know how ot do it
im more like server-side scripting type of guy


<table align="center" width="100%" height="100%"><tr align="center"
valign="middle"><td>

<table width="750" align="center" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td height="50" align="center" valign="top">
<!-- TOP -->
</td>
</tr>

<tr>
<td height=" <!-- RESIZE THIS DEPENDING ON THE WINDOWS SIZE -->
" align="center" valign="top">
<!-- CONTENT -->
</td>
</tr>

<tr>
<td height="50" align="center" valign="bottom">
<!-- BOTTOM -->
</td>
</tr>
</table>

</td></tr></table>
Jul 23 '05 #1
3 4744
Here is my hack from a year or so back with a similar problem but I
was sizing iFrames.

JsD
<body>
<table align="center" width="100%" height="100%"><tr align="center"
valign="middle"><td>

<table width="750" align="center" border="1" cellpadding="0"
cellspacing="0">
<tr>
<td height="50" align="center" valign="top">
top
</td>
</tr>

<tr>
<td id=tdMiddle height=100% align="center" valign="top">
middle
</td>
</tr>

<tr>
<td height="50" align="center" valign="bottom">
bottom
</td>
</tr>
</table>

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

<script>
_w=window
_d=document
// General Utility Functions
function winWidth(){return is.ie?_d.body.clientWidth:_w.innerWidth}
function winHeight(){return is.ie?_d.body.clientHeight:_w.innerHeight}
function ClientSniffer(){//IE5.5+&Mozilla 5+
var t=this, n=navigator,sUA=n.userAgent.toLowerCase(),i
t.ie=false;t.moz=false
if(
(i=sUA.indexOf('msie'))>-1
&&parseFloat(sUA.substring(i+5,sUA.length))>=5. 5
){
t.ie=true
}else{
if(sUA.indexOf('gecko')!=-1
&&parseInt(n.appVersion
)>=5){
t.moz=true
}
}
}; _w.is=new ClientSniffer()
oTD=_d.getElementById("tdMiddle")
function setIFSize(){
oTD.style.height=winHeight()-100-30
}

_w.onresize=setIFSize
setIFSize()
</script>
</body>
Jul 23 '05 #2
Java script Dude wrote:
Here is my hack from a year or so back
It dates back to the stone age, does it not?
[...]
<body>
<table align="center" width="100%" height="100%"><tr align="center"
valign="middle">
A "table" element does not have a "height" attribute (in Valid HTML).
<td>

<table width="750" align="center" border="1" cellpadding="0"
cellspacing="0">
<tr>
<td height="50" align="center" valign="top">
top
</td>
</tr>

<tr>
<td id=tdMiddle height=100% align="center" valign="top">
middle
</td>
</tr>

<tr>
<td height="50" align="center" valign="bottom">
bottom
</td>
</tr>
</table>

</td></tr></table>
Never ever use tables for layout purposes alone.
A table is a table is a table. [psf 3.8]
<script> ^^^^ _w=window
_d=document
Huh?
// General Utility Functions
function winWidth(){return is.ie?_d.body.clientWidth:_w.innerWidth} ^^^^^ function winHeight(){return is.ie?_d.body.clientHeight:_w.innerHeight} ^^^^^ function ClientSniffer(){//IE5.5+&Mozilla 5+
var t=this, n=navigator,sUA=n.userAgent.toLowerCase(),i
t.ie=false;t.moz=false
if(
(i=sUA.indexOf('msie'))>-1 ^^^^^^^^^^^^^^^^^^^ &&parseFloat(sUA.substring(i+5,sUA.length))>=5. 5 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ){
t.ie=true
}else{
if(sUA.indexOf('gecko')!=-1 ^^^^^^^^^^^^^^^^^^^^^^^^ &&parseInt(n.appVersion
)>=5){ ^^^^^^^^^^^^^^^^^^^^^^^ t.moz=true
}
}
}; _w.is=new ClientSniffer()
oTD=_d.getElementById("tdMiddle") ^^^^^^^^^^^^^^^^^ function setIFSize(){
oTD.style.height=winHeight()-100-30
}

_w.onresize=setIFSize
setIFSize()
</script>
</body>


Eeek. What a load of rubbish.

<http://pointedears.de/scripts/test/whatami>
PointedEars
--
C code. C code run. Run, code, run... PLEASE!!!
Jul 23 '05 #3
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in message news:<57****************@PointedEars.de>...
Java script Dude wrote:
Here is my hack from a year or so back


It dates back to the stone age, does it not?


:]
<Code_Snippet>


A "table" element does not have a "height" attribute (in Valid HTML).


Posted this to the wrong node. This should be for Mario's post.

<Code_Snippet>


Never ever use tables for layout purposes alone.
A table is a table is a table. [psf 3.8]


Same again consistency is a good trait for programmers.

_w=window
_d=document


Huh?


`window` and `document` are the most commonly used instance variables
and as such, shortening their name will save char space in js sources,
which in any script language is a good thing. I borrowed this
methodology from a very good but now invisible js programmer - Stereo
Frog (www.stereofrog.com).
<Code_Snippet>


Eeek. What a load of rubbish.

Dude, this code was copied and pasted from some abstracted js
libraries. Unfortunately I did not have time to clean it up for the
copy and paste programmers around. BTW - Any decent hacker should be
able to reverse engineer and use.

JsD
Jul 23 '05 #4

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

Similar topics

0
by: TJ Talluto | last post by:
<facts> I have a "month calendar" that always displays exactly 42 days... and alongside is a vertical box that displays the detail (form fields) of any particular select event that appears on the...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
6
by: John Bowman | last post by:
Hi All, I must be missing something really obvious, so I'd appreciate someone helping me out. I have a simple Windows form that currently only has a title bar (aka the Text Property is set) and...
2
by: Mustufa Baig | last post by:
Can anybody tell me how or refer me a link where I can find the client side javascript to make the positions and resizing of the controls on .aspx page independent of screen resolution. As I am...
3
by: Darren | last post by:
OK, this should be really simple, but I still can't see where I can set an option to prevent Windows Media Player 9 from resizing the window when it loads at startup or when a file is played. I...
2
by: Darren | last post by:
OK, this should be really simple, but I still can't see where I can set an option to prevent Windows Media Player 9 SDK from resizing the control on the form when it loads at startup or when a file...
1
by: Nick ! | last post by:
Chris Share <usenet at caesium.me.ukwrote: http://web.cs.mun.ca/~rod/ncurses/ncurses.html#xterm says "The ncurses library does not catch signal, because it cannot in general know how you want...
9
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...
2
by: wannasee | last post by:
Hello everybody, I am new at javascript and I would like to write a script that resizes the input fieds of an html table depending on the entered text. The input fields are placed in table cells...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.