?
Solved

Drawing lines in tables

Posted on 2007-10-18
5
Medium Priority
?
231 Views
Last Modified: 2010-04-09
I want to put a HR within a table to divide the table in 1/2, but when I add a HR tag to the html it either puts it at the top of the table or within the cell only.  Can anybody help with this?  Here is an example

    <table align=center width=100%><tr style="border-top: solid; border-width:medium; border-color:Black" >
    <td align=center width=5%>Booth #</td>
    <td align=center width=30%>Description</td>
    <td align=center width=15%>Gross Sales</td>
    <td align=center width=15%>Price</td>
    <td align=center width=5%>Qty</td>
    <td align=center width=15%>Amount</td>
    <td width=15%></td></tr>
    <tr><td> item1</td>
    <td>cost1</td>
    <td>quantity1</td>
    <td>stuff 1</td></tr>
    <tr><td>item2</td>
    <td>cost2</td>
    <td>quantity2</td>
    <td>stuff2</td></tr></table>

I want to put a horizontal line between row1 and row2
0
Comment
Question by:flg8tor96
  • 3
5 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20104917
flg8tor96,

If it is between rows then you should use a border and CSS.  Try using the style tag below in the row2.

style="border-top-width: 5px;"

You can modify the size and use style to change color, etc.

Let me know how that works or if you need modification.  Let me know if you have any questions or need more information.

b0lsc0tt
0
 

Author Comment

by:flg8tor96
ID: 20104962
I put it in the <TR> element but it does not appear

    <table align=center width=100%><tr style="border-top: solid; border-width:medium; border-color:Black" >
    <td align=center width=5%>Booth #</td>
    <td align=center width=30%>Description</td>
    <td align=center width=15%>Gross Sales</td>
    <td align=center width=15%>Price</td>
    <td align=center width=5%>Qty</td>
    <td align=center width=15%>Amount</td>
    <td width=15%></td></tr>
    <tr><td> item1</td>
    <td>cost1</td>
    <td>quantity1</td>
    <td>stuff 1</td></tr>
    <tr style="border-top-width:5px"><td>item2</td>
    <td>cost2</td>
    <td>quantity2</td>
    <td>stuff2</td></tr></table>

what am I doing wrong?
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 2000 total points
ID: 20105047
It was my suggestion.  The style needs to be in the td tag (or each of them if there is more than one in a row).

style="border-top: 5px solid black;"

You should specify the type and color too.  Feel free to change any you need to change.  Let me know if you have a question about the options.  That should work though.

bol
0
 
LVL 15

Expert Comment

by:danrosenthal
ID: 20105387
How about adding this?:
      <TR><TD colspan="6" style="border-top: 5px solid black;">&nbsp;</TD></TR>
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20112698
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question