473,327 Members | 1,976 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,327 software developers and data experts.

Maximum width with <SPAN>

Hi, i am stuck using older ASP and have to dinamically fill a
converted-word file as a form.
Let´s suppose a row on a table has the name of someone like in a
declaration:

<span>Some random guy</span>, currently employed at ...

The problem is that the location of the next part of the line
("currently employed") varies on the length of the text inside the
span.

So i want to somehow have a maximum width on the span, so if the length
is too short
it would look like this:

Some random guy
__________________________________________ , currently employed...

Like if it was a real life form.

I have decorated the span with text-decoration:underline; and tried to
set a width but this doesn't work.

Anyone has an idea, besides spending 300$ for asppdf and using PDF like
i should be?

Jun 1 '06 #1
10 8431
fj****@gmail.com <fj****@gmail.com> scripsit:
Hi, i am stuck using older ASP and have to dinamically fill a
converted-word file as a form.
What's a converted word? :-) Seriously, your problem description is far from
clear, and the lack of any URL makes it impossible to make good guesses of
what you are really doing. The odds are that the problem is not at the CSS
level, or that some more fundamental issues need to be settled down before
you can even specify the CSS problem in the right setting and right way.
Let´s suppose a row on a table has the name of someone like in a
declaration:

<span>Some random guy</span>, currently employed at ...
A row on a table? What has that got to do with anything?
The problem is that the location of the next part of the line
("currently employed") varies on the length of the text inside the
span.
Right. And this is a _problem_ exactly how?

Do you mean that you are trying to create a printed form using HTML and CSS?
Why?
Like if it was a real life form.
You mean a paper form? Why?
I have decorated the span with text-decoration:underline; and tried to
set a width but this doesn't work.
To produce a continuous line, why don't you use a sequence of underline
characters "_"?
Anyone has an idea, besides spending 300$ for asppdf and using PDF
like i should be?


Try telling the problem first.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Jun 1 '06 #2
The problem is that the location of the next part of the line
("currently employed") varies on the length of the text inside the
span.
Right. And this is a _problem_ exactly how?


If the name is too long, it may cause the form to be bigger, and can't
get printed on a single page. That is a problem.
You mean a paper form? Why?
We are an insurance company, and when a client request a policy over
our website, we hand them a form so they cant print it. But since the
previous guy on the job went
and saved the word file as html, they want me to do it the same way,
and save 300$ that would cost the asppdf plugin so i could give them a
pdf form instead.
To produce a continuous line, why don't you use a sequence of underline
characters "_"?
Because you can't put text over the ____ chars, unless you use two
rows, one for the name of the guy and one for the ____ chars
Try telling the problem first.


http://mipagina.cantv.net/fleona/wordform.gif
http://mipagina.cantv.net/fleona/webpage.gif

First image is how the word file looks. No matter how long the name is,
fields will appear at the same location.

Second image shows the table designed by scratch in html. I have to use
a blank image hack in order to make the word "titular, de" appear in
the same location.

If <span> tags had a width attribute, i could set a size on it no
matter how big or short the name of the guy would be. But after
searching on this group i learned that inline tags can't have width.
And if i use display:block on spans, then it inserts new lines before
and after the span. So i would need some floating implementation.

I hope the problem is clear now, thanks for your reply

Jun 2 '06 #3
fj****@gmail.com wrote:
The problem is that the location of the next part of the line
("currently employed") varies on the length of the text inside
the span.

Right. And this is a _problem_ exactly how?


If the name is too long, it may cause the form to be bigger, and
can't get printed on a single page. That is a problem.
You mean a paper form? Why?


We are an insurance company, and when a client request a policy over
our website, we hand them a form so they cant print it. But since the
previous guy on the job went and saved the word file as html, they
want me to do it the same way, and save 300$ that would cost the
asppdf plugin so i could give them a pdf form instead.


HTML is the wrong way to do this. If you want print forms, PDF is much
better; you don't have to buy fancy software to make PDF files, there
are free ways of doing it. ApacheFOP, for example, will create PDF files
from XSL:FO markup.

--
Jack.
Jun 2 '06 #4
Jack <mr*********@nospam.jackpot.uk.net> scripsit:
HTML is the wrong way to do this. If you want print forms, PDF is much
better; you don't have to buy fancy software to make PDF files, there
are free ways of doing it.


If I worked for an insurance company, I would not expect a $300 software
cost to be excessive.

Besides, even Word format makes more sense than HTML for a _print_ form. On
the other hand, using the Web just as a method for distributing print forms
sounds rather primitive.

Of course, one can set max-width for a <span> element. This has little to do
with the real problem, whatever it is.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Jun 2 '06 #5
Jukka K. Korpela wrote:
Jack <mr*********@nospam.jackpot.uk.net> scripsit:
HTML is the wrong way to do this. If you want print forms, PDF is much
better; you don't have to buy fancy software to make PDF files, there
are free ways of doing it.


If I worked for an insurance company, I would not expect a $300 software
cost to be excessive.


Besides which, any work-around will probably incur at least $300 in
billable time in development and testing.
Jun 2 '06 #6
fj****@gmail.com wrote:
Hi, i am stuck using older ASP and have to dinamically fill a
converted-word file as a form.
Let´s suppose a row on a table has the name of someone like in a
declaration:

<span>Some random guy</span>, currently employed at ...

The problem is that the location of the next part of the line
("currently employed") varies on the length of the text inside the
span.

So i want to somehow have a maximum width on the span, so if the length
is too short
it would look like this:

Some random guy
__________________________________________ , currently employed...

Like if it was a real life form.

I have decorated the span with text-decoration:underline; and tried to
set a width but this doesn't work.


I wouldn't expect text-decoration to cover the full span. Try border-bottom.
Jun 2 '06 #7
FJ
Besides which, any work-around will probably incur at least $300 in
billable time in development and testing.


Like i said of the first message, i know i should do it with PDF,
however i am living in a third world country and the common guy here
isn't knowledgeable on computers. Almost everyone don't know anything
rather than windows, internet explorer and msn.

Requiring users to have adobe pdf installed with the browser plugin (or
another alternative) would upset our users.

Anyone, someone here commented that setting a max width is possible on
spans... How?

The only other alternative i know would be to nest tables inside
tables, as much as necessary, to set widths on the <td>'s as needed.

Jun 2 '06 #8
In article <11**********************@u72g2000cwu.googlegroups .com>,
FJ <fj****@gmail.com> wrote:
The only other alternative i know would be to nest tables inside
tables, as much as necessary, to set widths on the <td>'s as needed.


To me, that sounds like the quickest and cheapest way to get the
results you want. You have a form that you want to print, and you
want it to print and display consistently always. That means all
the various parts of the form must maintain a physical relationship
with each other, both horizontally and vertically.

Anything that requires such relationships between elements is
tabular data, so using tables is appropriate, if a bit messy.

-A
Jun 2 '06 #9
To further the education of mankind, fj****@gmail.com vouchsafed:
Hi, i am stuck using older ASP and have to dinamically fill a
converted-word file as a form.
Let´s suppose a row on a table has the name of someone like in a
declaration:

<span>Some random guy</span>, currently employed at ...

The problem is that the location of the next part of the line
("currently employed") varies on the length of the text inside the
span.

So i want to somehow have a maximum width on the span, so if the length
is too short
it would look like this:

Some random guy
__________________________________________ , currently employed...


No, this suggests you wish to set a _minimum_ width, although you may
desire a maximum one as well.

Anyway, one way to do that would be to absolutely-position a 'random guy'
div inside a relatively-positioned 'currently-employed' div having a left
padding of the desired dimension.

--
Neredbojias
Infinity has its limits.
Jun 3 '06 #10
On 02/06/2006 17:18, Jukka K. Korpela wrote:

[snip]
Of course, one can set max-width for a <span> element.


Though one shouldn't expect such a declaration to have any affect. The
min- and max-width properties apply to "all elements except non-replaced
inline elements and table elements".

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jun 12 '06 #11

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

Similar topics

3
by: Alexander Ross | last post by:
I have an html snippet, and I want to remove any <span> tags that have a specific attribute (class=none) ex. The quick brown <span class="animal">fox</span> jumped <span...
13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
4
by: Tristan Miller | last post by:
Greetings. Occasionally I come across sites that use something like the following combination of CSS and HTML: h1 { height:100px; width: 500px; background:url(welcome.gif) no-repeat; }
18
by: Timothy Casey | last post by:
Thanks in advance... =~= Timothy Casey South Australia worloq@iprimus.com.au Formerly: casey@smart.net.au
9
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from...
6
by: hsomob1999 | last post by:
so i have a <ul> and I allow the user to append items to it. The problem is that on mozilla the <span class="line"> which is just a line to divide the sections gets overlaped and doesnt move down...
6
by: lilOlMe | last post by:
Hi there! I'm having a problem with a <span> element's width. I have a span element within a div block: <div class="picker"> <span id="ctl00_cph_mainContent_TPKR_Tues_LBL_TitleForPicker"...
1
by: rynato | last post by:
I have a <spanof width X px and height Y px. I want to read the text of an article, which is stored in a mySQL table, and pass to that <spanonly just enough text to fit in it, along with a 'read...
5
by: Brent | last post by:
Take this small HTML fragment: span.theClass{float:left;width:100px;cursor:pointer;cursor:hand;} ------------------------ <div> <span id="1" class="theClass">&nbsp;<span> <span id="2"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.