HTML - problem with white spaces

P

Piotr.Ozaist

Hi everybody,
I've got a problem with html.
Does anybody know what I have to do (special tag, some styles) if I
want that html code like:
<html>
<body>
<table>
<tr>
<td>
a
b
c
</td>
</tr>
</table>
</body>
</html>
will produce
"abc"
not
"a b c"

I know that this white spaces comes from new line char, but I want to
remove them and I the content of <TD> tag have to be written like in
example above.

I tried some styles, tags like <NOBR> but it doesn't work.
Please help :)

Ozi
 
N

Neredbojias

With neither quill nor qualm, (e-mail address removed) quothed:
Hi everybody,
I've got a problem with html.
Does anybody know what I have to do (special tag, some styles) if I
want that html code like:
<html>
<body>
<table>
<tr>
<td>
a
b
c
</td>
</tr>
</table>
</body>
</html>
will produce
"abc"
not
"a b c"

I know that this white spaces comes from new line char, but I want to
remove them and I the content of <TD> tag have to be written like in
example above.

I tried some styles, tags like <NOBR> but it doesn't work.
Please help :)

Ozi

One thing that will help is doing this:

<td>
a
b
c</td>

Another thing you can try is to style the cell as:

white-space:nowrap;

-if, indeed, the text doesn't need to wrap.

You can also try:

letter-spacing:1px:

for example, but the spacing will then not be "normal".
 
T

turbo

<body>
<table>
<tr>
<td>
a
b
c
</td>
</tr>
</table>
</body>
</html>
will produce
"abc"
not
"a b c"
*************************

<html>
<body>
<table>
<tr>
<td>
a b c&nbsp;
</td>
</tr>
</table>
</body>
</html>
 
E

Els

Hi everybody,
I've got a problem with html.
Does anybody know what I have to do (special tag, some styles) if I
want that html code like:
<html>
<body>
<table>
<tr>
<td>
a
b
c
</td>
</tr>
</table>
</body>
</html>
will produce
"abc"
not
"a b c"

I know that this white spaces comes from new line char, but I want to
remove them and I the content of <TD> tag have to be written like in
example above.

I tried some styles, tags like <NOBR> but it doesn't work.
Please help :)

Have you tried eliminating the space on the left of the characters?
<td>
a
b
c
</td>
instead of
<td>
a
b
c
</td>

?

Curiosity is my middel name: /why/ do you want to write the content
like
a
b
c
instead of abc?
 
P

Piotr.Ozaist

Thanks but,
First.
Of course eliminating the space on the left of the characters is
correct - I did it to have better formating of this example but in real
this is like this:
<html>
<body>
<table>
<tr>
<td>
a
b
c
</td>
</tr>
</table>
</body>
</html>

And second.
As I've written it was only example. In real program/web page I have to
do some refactor of JSP page to eliminate some white spaces. I've got a
code like:
<logic:equal condition1 bean-write - ... />
<logic:equal condition2 bean-write - ... />
....
<logic:equal conditionN bean-write - ... />

and the result of this code looks like our
"a b c"
from example.
But I want "abc"
Of course I can write it in JSP like:
<logic:equal condition1 bean-write - ... /><logic:equal condition2
bean-write - ... />...<logic:equal conditionN bean-write - ... />
but it is not nice code, don't U think??

Ozi
 
E

Els

As I've written it was only example. In real program/web page I have to
do some refactor of JSP page to eliminate some white spaces. I've got a
code like:
<logic:equal condition1 bean-write - ... />
<logic:equal condition2 bean-write - ... />
...
<logic:equal conditionN bean-write - ... />

and the result of this code looks like our
"a b c"
from example.
But I want "abc"
Of course I can write it in JSP like:
<logic:equal condition1 bean-write - ... /><logic:equal condition2
bean-write - ... />...<logic:equal conditionN bean-write - ... />
but it is not nice code, don't U think??

True, but not too difficult to solve I think.
I'd write the code like:

<logic:equal condition1 bean-write - ... />
<logic:equal condition2 bean-write - ... />

And after having finished the code, do a search and replace, changing
all instances of:
/>\n<logic
into:
/><logic

I mean, after the code is written and checked, there's no need to keep
it nice looking really. You can easily enough save a nice looking copy
in case you ever need to make changes, and use the not-so-nice looking
copy to do the job.
 
M

Mitja Trampus

As I've written it was only example. In real program/web page I have to
do some refactor of JSP page to eliminate some white spaces. I've got a
code like:
<logic:equal condition1 bean-write - ... />
<logic:equal condition2 bean-write - ... />
...
<logic:equal conditionN bean-write - ... />

and the result of this code looks like our
"a b c"
from example.
But I want "abc"
Of course I can write it in JSP like:
<logic:equal condition1 bean-write - ... /><logic:equal condition2
bean-write - ... />...<logic:equal conditionN bean-write - ... />
but it is not nice code, don't U think??

How about
<
logic:equal condition1 bean-write - ...
/><
logic:equal condition2 bean-write - ...
/>...<
logic:equal conditionN bean-write - ...
/>

(or with />< and logic:... squeezed on one line, if you like
it better).
 
J

Jukka K. Korpela

Hi everybody,

Everybody just left, sorry. You have to do with Anybody, sorry.
I've got a problem with html.

We all do, don't we? Next time, please get to the point in the first
sentence.
Does anybody know what I have to do (special tag, some styles) if I
want that html code like:

Then you present some childish code. You have it, don't you? So what is the
problem?
I know that this white spaces comes from new line char,

Which white space?
but I want to
remove them and I the content of <TD> tag have to be written like in
example above.

You are not making any sense here.
I tried some styles, tags like <NOBR> but it doesn't work.
Please help :)

Try explaining the problem you have, and illustrate it with a real URL.

Problem with white space? Who hasn't? Some of us have too much of it, some
of us have too little of it. Different problems, different solutions.
It's like "problem with money", except that we can conjecture that most
people have too little of it.
 
E

Els

Jukka said:
Then you present some childish code. You have it, don't you? So what is the
problem?

You snipped the explanation of the problem, Yucca/Jukka.
Why couldn't you understand what the OP managed to convey in his best
English? Could it be your lack of understanding maybe?
Did you notice that some other people actually /did/ understand what
Piotr tried to achieve, and why, and how?
Which white space?

Shown in the sentence below the code, which you snipped together with
that code.
You are not making any sense here.

He is. I understood, Mitja understood, Neredbojias understood...
Why didn't you understand?
 
K

kklk

well... looks like people like to increase problems and complex things.

HTML does not care about white spaces in the code...
so writting
....<td>
a
b
c
</td>
and
....<td>abc</td>...

will look exactly the same on the browser : you'll see : abc

if you want : a b c
you need to tell to browser that you actually want a white space

the specific code for a white space is &nbsp;
so
having

a&nbsp;b&nbsp;c

will look like : a b c

hope it help.

++
R.
 
E

Els

kklk wrote:

Please don't toppost.
HTML does not care about white spaces in the code...
so writting
...<td>
a
b
c
</td>
and
...<td>abc</td>...

will look exactly the same on the browser : you'll see : abc

Just try it yourself, and see that you're wrong.
Placing the next letter on the next line, will show spaces between
them in the actual page. Line-breaks aren't the same as whitespace.
 
O

Obvious

He is. I understood, Mitja understood, Neredbojias understood...
Why didn't you understand?

Because he gets off on belittling anyone who is unfortunate enough to need
to ask a question here.
 
L

Leonard Blaisdell

Els said:
Jukka K. Korpela wrote:

He is. I understood, Mitja understood, Neredbojias understood...
Why didn't you understand?

I almost replied in the negative first, but I have a great respect for
his ability regarding HTML interfaces with language constructs in
general. The Finnish winters are long, cold and just starting. A sojourn
on an antipodean island would be just the ticket. I take his X-Face
seriously.

leo
 
E

Els

Leonard said:
I almost replied in the negative first, but I have a great respect for
his ability regarding HTML interfaces with language constructs in
general.

Me too, which is why I only reply to him when I know I'm right about
what I tell him. This was a nice opportunity ;-)
The Finnish winters are long, cold and just starting.

If he'd say "sorry for my attitude but I'm just freezing cold and I
couldn't help myself" only now and then, I'd accept that as an excuse.

I don't mind a bit of patronizing condescending holier than thou
attitude while he's giving someone good and helpful information. But
this post was all that for no reason.
A sojourn
on an antipodean island would be just the ticket. I take his X-Face
seriously.

:)
 
J

Jukka K. Korpela

Els said:
Why couldn't you understand what the OP managed to convey in his best
English?

Because it made no sense. And as I indirectly suggested, posting a URL
helps a lot with language problems.
Could it be your lack of understanding maybe?

It isn't. But if you think so, you could have explained the problem.
Now you are just whining.

It doesn't make any sense to write a b c and then say it should be abc,
especially when you don't say what a, b, and c really are.

If you think the problem is that someone wants abc but does not want to
write abc, why don't you suggest a constructive solution to that?
 
E

Els

Jukka said:
Because it made no sense. And as I indirectly suggested, posting a URL
helps a lot with language problems.

The OP's English was far from insufficient. I said he /managed/ to
convey. Without a URL, showing only a minimal bit of code, which in
this case was fine imo, as the rendering of 3 letters in a table cell
had nothing to do with whatever would be on the rest of the page.
It isn't. But if you think so, you could have explained the problem.
Now you are just whining.

I should have explained the problem to you?
The problem was clearly explained by the OP - imo you just failed to
read it properly. If I would have seen where you misunderstood and
why, I'd have explained, sure.
It doesn't make any sense to write a b c and then say it should be abc,
especially when you don't say what a, b, and c really are.

You didn't read the rest of the replies, did you?
If you think the problem is that someone wants abc but does not want to
write abc, why don't you suggest a constructive solution to that?

I asked the OP if he had tried a certain solution, and he replied he
had, and that it didn't work.

I also asked for the reason for writing a b c while needing abc,
without just simply saying it doesn't make sense. We don't know if it
makes sense, until we have asked for the reason.

It appeared it maked perfect sense, and I gave a solution that could
possibly work for the OP's situation. Mitja then came with a more
constructive solution, to which I had nothing more to add.
 
J

Jukka K. Korpela

Els said:
The problem was clearly explained by the OP

I don't see why you keep saying so, when you have yourself noticed that the
real problem had nothing to do with the original description. All the table
markup seems to be irrelevant, and so are a, b, and c, and that was all
that the original question was about. A question of how to write tags
without spaces between them is something different, and apparently the OP
_had_ a solution to that problem - he just didn't like it.

And we still don't know what the real HTML document in question is and what
the problem _really_ is in HTML terms (if there is a problem in HTML
terms).
 
E

Els

Jukka said:
I don't see why you keep saying so, when you have yourself noticed that the
real problem had nothing to do with the original description. All the table
markup seems to be irrelevant, and so are a, b, and c, and that was all
that the original question was about. A question of how to write tags
without spaces between them is something different, and apparently the OP
_had_ a solution to that problem - he just didn't like it.

And we still don't know what the real HTML document in question is and what
the problem _really_ is in HTML terms (if there is a problem in HTML
terms).

Ah, now I understand the meaning of your post.
You were merely questioning if the problem was really an HTML problem,
combined with noting that the OP would have done better if he'd
explained the full details, nature, reasoning and motives for his
question.
Am I close?

Well, my objection was not with that, but with the attitude and the
manner of saying what you tried to say. I didn't think there was a
reason to accuse the OP of showing "childish code" or plainly telling
him he is "not making any sense", followed by "try explaining the
problem you have", as if he hadn't tried that (and succeeded) already
in the two posts he made in the thread.

On a sidenote, I think there is no harm in people asking things in
alt.html because they didn't realize the solution would have been
better found outside the constraints of HTML code. It's often by
asking the wrong question in the wrong place, that one finds out what
the real problem is. IMO, the OP merely thought he might be able to
find the solution in an HTML or CSS property, and decided to ask in
alt.html.
 
J

Jukka K. Korpela

Els said:
Ah, now I understand the meaning of your post.
You were merely questioning if the problem was really an HTML problem,

No I wasn't. I don't see why you continue this thread, but it's surely not
useful that you proclaim you understand what I wrote, especially when you
clearly didn't.
 
E

Els

Jukka said:
No I wasn't. I don't see why you continue this thread,
Likewise.

but it's surely not
useful that you proclaim you understand what I wrote, especially when you
clearly didn't.

Explain it to me then. What was the reason for your post?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top