tablerow separation

F

Frank

Hi all,
in an HTML table (with css file) I want to have a separation line after
every 3rd row. How can I do that?
Thanks
Frank
 
B

Beauregard T. Shagnasty

Frank said:
in an HTML table (with css file) I want to have a separation line
after every 3rd row. How can I do that?

Without more details, try this, where N is the number of columns in your
data:

<td colspan="N">&nbsp;</td>

How are you generating the table?
 
J

Jonathan N. Little

Beauregard said:
Without more details, try this, where N is the number of columns in your
data:

<td colspan="N">&nbsp;</td>

Not sure what OP means by separation line, if just a 'visual' marker I
would just adjust the border and not insert a blank row, easy with style,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en-us">

<title>With Css</title>

<style type="text/css">
TABLE { border-collapse: collapse; border: 3px solid #000; }
TD { border: 1px solid #888; margin: 0; padding: .5em; }
TR.spacer TD{ border-bottom: 10px solid #f00; }
</style>

</head>
<body>

<table>
<caption>Every Third</caption>
<tr><td>A1</td><td>B1</td><td>C1</td></tr>
<tr><td>A2</td><td>B2</td><td>C2</td></tr>
<tr class="spacer"><td>A3</td><td>B3</td><td>C3</td></tr>
<tr><td>A4</td><td>B4</td><td>C4</td></tr>
<tr><td>A5</td><td>B5</td><td>C5</td></tr>
<tr class="spacer"><td>A6</td><td>B6</td><td>C6</td></tr>
<tr><td>A7</td><td>B7</td><td>C7</td></tr>
</table>
</body>
</html>
 
D

dorayme

"Jonathan N. Little said:
Not sure what OP means by separation line, if just a 'visual' marker I
would just adjust the border and not insert a blank row, easy with style,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

Perhaps this is taking the idea of a separation line too far, a
thick red border? It is not the particular colour I am saying is
is "too far", any colour at all, see what happens if he wants
white, look at how the main table black border gets gaps.

So, I think not the best solution given likely pleasant look
requirements.
 
F

Frank

Thank you all,
Jonathans solution is fine, although with a bit thinner line, but that I can
do myself.
I could not find the right solution, must have done something wrong all the
time.
Regards
Frank
 
J

Jonathan N. Little

dorayme wrote:

Perhaps this is taking the idea of a separation line too far, a
thick red border? It is not the particular colour I am saying is
is "too far", any colour at all, see what happens if he wants
white, look at how the main table black border gets gaps.
Com'on dorayme, you know me better. I know style. I used red to make a
clear example of how the process works. Never intended one to use CSS
exactly as in the example!

It is just a blank row in a table has a different semantic meaning that
just a wider border. Depends on why OP needs the separation. If to make
a change in the relation of the data then semantically one should
separate the data with separate tables!

If the reason is for clarity with large multi-column multi-row table
then tinted row/column backgrounds on my border solution would be
applicable.

But if it is for some special spacing to hang part of a web page on,
then one should stop using a table for layout.

Of course if Frank here had suppled a URL, there'd be no mystery!
 
D

dorayme

"Jonathan N. Little said:
dorayme wrote:


Com'on dorayme, you know me better. I know style. I used red to make a
clear example of how the process works. Never intended one to use CSS
exactly as in the example!

C'mon* Jonathan, of course I know about examples and trying to
read the essentials through them. But please read what I said. I
specifically discounted the particular colour issue. I was
pointing to what I perceived to be a deeper problem. Which can be
seen if you do what I indicated.

Since it is you, if you cannot see what I am talking about, I
will dig it out and make you a nice pic of what I see with your
code when someone wants to have a plain white bg. Also a pic of
where there is a tint (it really is not the colour that matters
but the intruding of it into the main table border).

I would have thought the natural thing would be to have the row
that ends just before the gap showing its normal bottom border
(made up of the composing cell bottom borders), then a gap that
does not break the main table thick border. Perhaps what I see is
browser dependent but it appears on my Safari and FF.

No offence, Jonathan, but old B's solution, visually if not
semantically, looked a better bet. But you may be able to modify
yours and have the whole world.

In a way, it is not just about what the OP might accept, the fact
is that he has thrown a carcass into this lion's den and we are
having a chew. <g>

* that's the Oz spelling
 
J

Jonathan N. Little

dorayme said:
"Jonathan N. Little" <[email protected]> wrote:

C'mon* Jonathan, of course I know about examples and trying to
read the essentials through them.

Thank you, dang I was struggling trying to discover how to spell that!
By the time spent pondering I just could have spelled it all out!
But please read what I said. I
specifically discounted the particular colour issue. I was
pointing to what I perceived to be a deeper problem. Which can be
seen if you do what I indicated.

Well it went in though my eyes but apparently didn't tickle the 'old
grey cells' properly to comprehend it! Sorry, I see. However we really
do not know what the OP is *really* trying to do since there is no code
of his attempts provided.
 
D

dorayme

But please read what I said. I
specifically discounted the particular colour issue. I was
pointing to what I perceived to be a deeper problem. Which can be
seen if you do what I indicated.

Well it went in though my eyes but apparently didn't tickle the 'old
grey cells' properly to comprehend it! Sorry, I see. However we really
do not know what the OP is *really* trying to do since there is no code
of his attempts provided.[/QUOTE]

I know what you mean. I tried instead to imagine a practical use
of this and I could not imagine where the effect you were
achieving I was pointing out would be acceptable to the eye. But
I can easily imagine wanting breaks in tables. Like, in fact, the
effect one gets when you stick in "nothing" and one cell to span
the row... at the cost of semantics! Which is why, though I did
not study B's (gee, I hope he does not take the "old" bit
personally, I will leave it out just once here to show respect)
suggestion, it looked practical.
 

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

Forum statistics

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

Latest Threads

Top