473,770 Members | 6,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting a form field to fill a table cell

Hi,

Short question:

Is it possible to write a CSS-Style that formats <INPUT TYPE=TEXT>-Elements
in Table-Cells in a way that they use all the horizontal space available?

Long question:

I export spreadsheets from Excel to HTML. The resulting HTML is horrible to
look at, but renders OK in Internet Explorer. The basic principle is a huge
table with an embedded stylesheet that formats everything as it were in Excel
or as close as possible. Plus lots of extra stuff including custom tags that I
don't understand and do not want to investigate if I can avoid it.

Now I am to process this HTML so that the HTML declares a Form with
Input-Elements for some of the cells. More precisely I am writing a program
that does this processing based on some rules telling it where to put an
Input.

I would like to be able to add my INPUT-Elements in such a way that they use
the available width of the table-cell they are in. But all I can manage is
absolute widths which according to Murphys law are either too wide and
overflow the cells or too narrow to hold the desired input while there is more
visible space around them.

Parsing the HTML to find the absolute width of the cell each Input is in to
then format it to the same width seems unfeasable.

Can't I just say: "Every INPUT in a TD should be as wide as possible"?

If so, how? Help!

Ciao, MM
--
Marian Aldenhövel, Rosenhain 23, 53123 Bonn. +49 228 624013.
http://www.marian-aldenhoevel.de
"There is a procedure to follow in these cases, and if followed it can
pretty well guarantee a generous measure of success, success here
defined as survival with major extremities remaining attached."
Jul 21 '05 #1
2 4185
Marian Aldenhövel <ma****@mba-software.de> wrote:
Is it possible to write a CSS-Style that formats <INPUT TYPE=TEXT>-Elements
in Table-Cells in a way that they use all the horizontal space available?


input{width:100 %}

You could have found this yourself in less time than it took you to
compose the message.

--
Spartanicus
Jul 21 '05 #2
Hi,
input{width:100 %}
Thank you very much.

In fact I tried that but it did not seem to help. Now with someone else
telling me that it is supposed to work that way I looked closer and found
out why.

In the case in question what looks like single cell is actually three of
them, formatted with lots of borders and non-borders to look like one.
And the inputfield of course stretches only to the width of the sub-cell
it is in.

That is OK, I can always blame the designer of the spreadsheet :-).
You could have found this yourself in less time than it took you to
compose the message.


I have been fiddling all day with this. May be easy if you know where
to look. If you don't it isn't.

Ciao, MM
--
Marian Aldenhövel, Rosenhain 23, 53123 Bonn. +49 228 624013.
http://www.marian-aldenhoevel.de
"There is a procedure to follow in these cases, and if followed it can
pretty well guarantee a generous measure of success, success here
defined as survival with major extremities remaining attached."
Jul 21 '05 #3

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

Similar topics

4
4297
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field that has been modified/clicked the form doesn't always submit. When it does work, a Stored procedure is passed form variables and updates to the db are made. When it doesn't, its as if the form wasn't submitted, it reloads and resets the page, but...
6
5034
by: tm | last post by:
I am trying to reference a table entry (qtyonhand) populated from a recordset. There is only one record displayed on this table. When i try to compare this displayed field to an input field (orderqty) i get an (error on this page or no result at all ). When just comparing the input field to a set of "" everything works fine. This is an ASP file with a javascript function. Thanks in advance. Signed... New at this! code below...
8
3072
by: news | last post by:
I seriously doubt this is possible...but you never know, so here goes. Due to bad pre-planning I have a Web page that is VERY table heavy with a very complicated and delicate setup. Any changes to the table structure, as in size changes or additions of new cells, throws the whole thing out of whack. (Let me pause here to say I understand quite well that tables in general are not a good idea anymore. Didn't know that until after I...
5
5903
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse button to open the "file browse" dialog and the Submit button to submit the form data.
7
6998
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form is correct I need to submit to another page that uses the form data. I first tried making the form submit action= field point to the same file. When the form was correct, I tried loading the next page by using <META http-equiv refresh>. But...
1
10505
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am trying to export to Excel using a command in an Access Form. RowID strFY AccountID CostElementWBS 1 2008 1 7 2 2008 1 7 I want to...
2
3578
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in uby/Rails. I started it in Perl and gave up on Perl as I went from the 'display the database information on the web page' to the 're-display the information from the database and allow the user to update the database using the web page' stage and realized...
2
3418
dlite922
by: dlite922 | last post by:
Before traversing my code, here's what my goal is and what this function does: I have a table of fields that dynamically grows as the user enters information. A minimum of 3 rows must always exist. (read the psedo code and comment if you need to know what it does) disregard the debugging , commented alerts. What i'm trying to do is without passing the ID or field that called this function, set the focus to the next element. what's...
1
2628
by: jeddiki | last post by:
Hello, I have made a nice opt-in form and tested it in Moz FF and it looks fine. But in IE the elements don't line up properly. I think I am nearly there but can not get these elements straight - can you see what I have missed ?
0
9592
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
10231
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...
0
9871
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...
0
8887
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5313
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
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
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
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
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.