473,554 Members | 3,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User alterable column/row sizes with IE

I'd like to know if it's possible to have
a drag style mechanism (or other simple
way) in which to alter the width of a
specific column or height of a specifi row
in a table.

For example, in the code below, if on my
Win 2K Pro IE 5.5 machine you click on the
border of the table, and then click and drag,
you can alter the width or height of the entire
table. (If you alter the width, you my notice
that the width of the two columns maintain a
3:2 ratio).

Thanks for any tips on how to do this for columns/rows,
Csaba Gabor from New York

<DIV contentEditable >
<TABLE border=1>
<COLGROUP style="width:1i n">
<COLGROUP style="width:1. 5in">
<TR>
<TD>foo</TD>
<TD>bar</TD>
</TR>
<TR>
<TD>baz</TD>
<TD>borf</TD>
</TR>
</TABLE>
</DIV>
Jul 20 '05 #1
3 5100
I've had difficulty with dynamically sizing tables.

Have you considered making your cells spans with various classes?
Then you can dynamically alter the class definitions to achieve
dynamic resizing.
Jul 20 '05 #2
Thanks for your idea. You could take several approaches to this
problem, such as the one that Yep offered. I haven't seen any
that are 100% satisfactory, but probably some can be refined. I'd
like to be able to use the built in positioning that contentEditable
offers (since it's built in - less javascript overhead), but I've only
gotten it to work nicely for the entire table resizing. Furthermore,
Yep's approach is more widely applicable.

I offer my approach with contentEditable (only works with IE 5.5+)
below, but it's not a clean solution. If you've got an example with
your dynamic SPAN redefinitions, it would be great to see it.

Regards from New York,
Csaba Gabor

<html>
<head>
<title>contentE ditable / table resizing tests</title>
<script type="text/javascript">
function prep() {
document.execCo mmand("2D-position",false ,true);
for (var span in document.getEle mentsByTagName( "SPAN"))
span.contentEdi table = true;
}
</script>
</head>
<body style="margin:5 %" onLoad="prep()" >
This is supposed to show how various settings affect the
alterability of table columns and rows. None of
them is satisfactory.<b r>Note that frob and Hello World
have to have contentEditable explicitly declared
in the element definition to have the 2D-Position enabled.
<br>Also, note that if the &lt;td> elements are enclosed in
&lt;div>s instead of &lt;span>s that there would be an
an extra space below each unless height was set to 100%
(which would disable row resizing).<br>& nbsp;
<div contentEditable style="border:d ashed 2px gold">
<table border=1>
<tr>
<td><span style="backgrou nd-color:red;heigh t:100%">foo</span></td>
</tr><tr>
<td><span style="backgrou nd-color:orange;wi dth:100%">bar</span></td>
</tr><tr>
<td><span style="backgrou nd-color:yellow;he ight:100%;width :100%">baz</span></td>
</tr><tr>
<td><span style="backgrou nd-color:green">fr ob</span></td>
</tr>

<tr>
<td style="height:2 .46em"><span style="backgrou nd-color:blue;heig ht:100%">Hi Mom</span></td>
</tr><tr>
<td style="height:2 .46em"><span style="backgrou nd-color:indigo;wi dth:100%">Hi Dad</span></td>
</tr><tr>
<td style="height:2 .46em"><span style="backgrou nd-color:violet;he ight:100%;width :100%">Hi Bro</span></td>
</tr><tr>
<td style="height:2 .46em"><span style="backgrou nd-color:silver">H ello World</span></td>
</tr>

</table></div></body></html>
"asdf asdf" <b0*****@yahoo. com> wrote in message news:6f******** *************** ***@posting.goo gle.com...
I've had difficulty with dynamically sizing tables.

Have you considered making your cells spans with various classes?
Then you can dynamically alter the class definitions to achieve
dynamic resizing.

Jul 20 '05 #3
Hi Yep,

Thanks for your reply and example. You have some neat
techniques in your coding. I've had a project on the back
burner for a while that needed to have editable cells (so
IE 5.5+ only) where the size adapted with 1 or 2 rows (scroll
bars if necessary). I had presumed that if I could do that,
then I would make no other demands on my system. Now
that my main problem is solved (through the wonderful
observation of Richard Cornford at
http://groups.google.com/groups?th=6397c6ac32865f50
in an earlier post) I realize once again that I have been
deluding myself. The original (and still current) approach
is to do what you suggest in allowing the user to enter
specific dimensions in some form field.

But I would love to put in column/row resizing via mouse
(because it will allow the user to be more efficient). And from
what I've seen so far, your approach is the one I like the most.
I think I should just ensure that the cursor changes to a hand
when it's over a border and somehow account for changing the
entire table width/height vs final column width/row height.

Another approach I thought of which I haven't been able
to make work cleanly uses contentEditable and is illustrated
under my response to "asdf asdf"within this thread.

Best regards from New York,
Csaba Gabor
Jul 20 '05 #4

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

Similar topics

6
4583
by: Brett Maton | last post by:
Hi NG, How do I find out the size of a column ? I am retrieving large objects from the pg_largeobject table and creating a files, I would like to know the length of the data column so that I can implement buffering instead of writing hundreds of small chunks to disk. Any help would be appreciated.
0
1789
by: Lester Knutsen | last post by:
Washington Area IBM Informix/DB2 User Group meeting - June 7, 2005 -------------------------------------------------------------- Mark the date, our next user group meeting will be another combined one with DB2 and Informix presentations.. Date: Tuseday, June 7, 2004 Time: 9:00-5:00 Location: IBM Fair Lakes Office
1
7833
by: JC Mugs | last post by:
Does anyone know how to set user defined paper sizes for and Epson LQ570E Printer under Windows XP Prof? The driver does not allow for user defined paper sizes.. So setting them from a report property, or through paper selection seems to be out of the question.. I have repeatedly sent e-mails to Epson, but they offer no solutions. (All the...
4
1263
by: Phil | last post by:
As a new user, I was pleased I was able to build tables and connect them properly (I think), but am having one problem on forms. How does one go about creating a form, where on field on the form is a combo box, where the selections in that box are from a table? I selected Table/Query in Properties for the combo box field. When using the...
0
1913
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. Chris. code :
0
1094
by: GroZZleR | last post by:
Hey all, How can you expand the column sizes to ALWAYS take up atleast 100% of the DataGrid / DataTable? Right now my columns look like this: http://www.grozzler.com/dump/dt_mine.png I want it to look more like this (minus the colours and such): http://www.grozzler.com/dump/dt_theirs.png
40
2931
by: Paul Davis | last post by:
Hi all, I'm building some style sheets and trying to play the old game of balancing designer pixel perfection and still allowing users to adjust their font sizes. The compromise I've made with the designer is that he'll accept allowing users to change font sizes it it "looks right" with the default setting. I'm using em to set the font size....
3
1769
by: Birky | last post by:
I’m looking for suggestions to see if it is possible to produce information in a read only format for my users. I have an event log within an Access table which tracks all the installations within our servers (there are 34 different servers by the way). The users need the ability to query this information by the specific server name. How can I...
1
3525
by: Man4ish | last post by:
Hi, How Eventlistner can be used with rendred combo box. I got one example of combobox in table as follows . /* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are...
0
7594
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...
0
7792
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. ...
0
8034
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7885
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...
0
6137
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5151
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...
0
3555
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...
1
1125
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
835
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...

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.