Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<hr> between rows in a table 2

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
Is it possible to get a full horizontal rule between rows in a table? If so, how? I have a rather large table that needs to be "parted" in order to keep it readable. I tried creating separate tables, but that screws up the alignment.
This can't be too hard.......

Any thoughts?
 
I figured it out.....if you're interested:

<tr>
<td>
<td>
</tr>
<TH COLSPAN=3><hr>
<tr>
<td>
and so on.....

 
You could also have partial borders I guess.
b2 - benbiddington@surf4nix.com
 
Hi MikeT!
This is what I use in this case:

insert a new table row
...

<tr>
<td colspan='total_number_of_cols' bgcolor='line_color' background='backgr.gif' style='font-size:1pt'>NBSP</td>
</tr>

...

NBSP is & n b s p ; char (without spaces).

backgr.gif - is a transparent image. It's height should be equal to the height of a line you want to create. In this case you can always change the colour of line by changing BGCOLOR attribute.
Seldom you want a thin line with height of some pixels. That's why you should add a style to a table cell, because the default size of characters (and & n b s p ; as well) is bigger. If there are many such cells, I prefer to use global style definition:

...
<style>
.line { font-size:1pt }
</style>
...

<td ... class=line>

It always works and is fully customizable, that's why I like this method, although it may sounds a little bit complicated. But if you try it you'll see how easy it is to use.

Andrew | starway@mail.com
 
those are pretty good ideas - thanks for your replies!
 
You know... After thinking about this over night I remembered what we did in just such a situation.

If you change the table cell color of every other row it makes it really easy to follow the lines accross.

You don't need extreme color variations either (black and yellow for example). If one row is white then all you need is a very, very light grey in the other row to make it work.

Look at this example and you will see what I mean:
Code:
<table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;3&quot;>
  <tr>
    <td width=&quot;100%&quot; nowrap>text text text text text text text text text text
      text text text </td>
  </tr>
  <tr>
    <td width=&quot;100%&quot; bgcolor=&quot;#F5F5F5&quot; nowrap>text text text text text text text
      text text text text text text </td>
  </tr>
</table>
» » » » » »
Mike Barone
FREE and Pro CGI/Perl Scripts
 
Changing the cell backgound color is exactly what I need for a different table I have....I can't believe I didn't think of that! Thanks!
 
Ok MikeB- Now When I print the table the grey rows are still the original color, even though they are grey in the browser. I assume this is because the Print Background Color property of the browser is turned off. How do I turn it on from the .asp? Then will I need to turn it back off again? While I'm at it, I would also like the default header and footer to NOT print also, but only for this page. Thanks for all your help!
 
&quot;While I'm at it, I would also like the default header and footer to NOT print also, but only for this page&quot; --> you should check about the @page property in css
basically, it allows you to set what is displayed, and what is printed for a page - and they can be different !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top