0

in Internet Explorer 5.5,6 & 7, the <br> tag takes one more space.

I am working on dynamic hide/show row of table. I met an issue while hiding a row, the row next to it having <br> in their data (Regard as rabid unless proven <br> negative by laboratory ), takes more space.

Is it possible to achieve the same functionality of <br> with <div> or <p> tag?

Mark
  • 6,762
  • 1
  • 33
  • 50
GkDaGk
  • 55
  • 3
  • 9
  • 2
    It is a bit hard to understand your question. could you add an html snippet to show what you mean? (just prepend the text with four spaces and the html will show) – MortenSickel Oct 30 '12 at 13:29

3 Answers3

0

If I understood correctly you just want to make a <br /> with CSS.
This question is already answered:

How to give line-break from css, without using <br />?

Community
  • 1
  • 1
OschtärEi
  • 2,255
  • 3
  • 20
  • 41
  • 1
    you just want to make a ...? with CSS – Mark Oct 30 '12 at 14:27
  • @Mark tenhouse wrote
    in question source, and it has been converted to a line break. To avoid that you just need to use code formatting. If you find such strange behaviour look at the source of the question / answer by clicking the edit link and you'll probably find the cause.
    – Gabber Oct 30 '12 at 14:42
  • @Gabber i know, i was giving himself the opportunity to fix it, without me having to edit 1 or 3 chars where the minimum is 6. – Mark Oct 30 '12 at 15:12
0

You could do it like this if your still wondering:

<style>
p {
white-space: pre;
}
</style>
<p>hello
How are you</p>

This doesn't work in IE6 or 7 i have no idea about 8

p span {
    Border: pre;
}
<p><span>hello my name is</span>Thomas</p>

the above is another way of doing it. it should work in all browsers

Tom
  • 30
  • 3
-1

From a semantic point of view, no. <p> and <div> are tags enclosing text. But of cource, you may use <p>'s or <div>'s to achieve something that looks like what the <br> is doing (although you probably need some CSS to make it look exactly the same way).

Mark
  • 6,762
  • 1
  • 33
  • 50
MortenSickel
  • 2,118
  • 4
  • 26
  • 44