www.webdeveloper.com
Results 1 to 11 of 11

Thread: draw a line in between table rows

  1. #1
    Join Date
    Apr 2005
    Posts
    132

    draw a line in between table rows

    Have data as below. Everything I put them in a Table in jsp.
    how to draw the line below?

    Employee Name : Tom
    Dept : HHH
    Office : Hudi

    _____________________________ (How to draw this)

    Cust Name : jjjj
    Order : ppp


    Thanks.

  2. #2
    Join Date
    Feb 2005
    Posts
    345
    HTML Code:
    <table style="border-collapse: collapse;">
    <tr>
    <td style="border-bottom: 1px solid #000;">Office:</td>
    <td style="border-bottom: 1px solid #000;">Hudi</td>
    </tr>
    <tr>
    <td>Cust Name::</td>
    <td>jjjj</td>
    </tr>
    </table>

  3. #3
    Join Date
    Apr 2005
    Posts
    132
    Thankyou for your response

    I tried giving below in css
    .collapse-border {
    border-collapse: collapse;
    }

    .lineBorder {
    border-bottom: 1px solid #000;
    }


    In jsp
    <table style="collapse-border">
    .....
    .....
    <tr>
    <td style="lineBorder">
    <bean:message key="lbl.Orders"/> <bean:message key="colon"/>
    </td>
    <td style="lineBorder">
    <html:checkbox name="Form1" property="orders" />
    </td>
    <td></td>
    </tr>

    ...........
    ..........
    </table>

    But the line doesn't show.
    What wrong in here?
    Thanks.

  4. #4
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    Shouldn't this

    .lineBorder {
    border-bottom: 1px solid #000;
    }

    be this

    td.lineBorder {
    border-bottom: 1px solid #000;
    }

    AND

    this

    <td style="lineBorder">

    be this

    <td class="lineBorder">

    ???

    The way you've currently got it coded, you'd have to use a <div> to employ that lineborder class thing. I don't think that's what you're wanting....

    KDLA

  5. #5
    Join Date
    Apr 2005
    Posts
    132
    thanks. that worked.

    But there is a small gap between the columns like

    ______________________________ _________________________________


    How to remove this gap?

    Thanks.

  6. #6
    Join Date
    Nov 2005
    Posts
    9
    there you put style="border-collapse: collapse;"

  7. #7
    Join Date
    Apr 2005
    Posts
    132
    I already have this.

    .collapse-border {
    border-collapse: collapse;
    }

    <table style="collapse-border">

    But still the gap exists.

    What am I missing?

    Thanks.

  8. #8
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    It's the cell spacing and padding.

    Make your CSS this

    td.lineBorder {
    border-bottom: 1px solid #000;
    padding: 0;
    margin: 0;
    }

    if you're using just a blank table cell as the divider.

    KDLA

  9. #9
    Join Date
    Apr 2005
    Posts
    132
    thanks for your response.

    that didn't work either.

    What else can I try?

    Thanks.

  10. #10
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    It's unclear where the gap is and where the line should be.
    Is this the intention:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <title>Basic HTML</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <style type="text/css">
    table {
    border-collapse: collapse;
    }
    
    .lineBorder td {
    border-bottom: 1px solid #9cf;
    }
    </style>
    
    </head>
    <body>
    <table>
    <tr class="lineBorder">
    <td>lbl.Orders</td>
    <td>checkbox</td>
    <td></td>
    </tr>
    </table>
    </body>
    </html>

  11. #11
    Join Date
    Apr 2005
    Posts
    132
    thanks guys for helping me. got it wokring now.

    table.collapse-border {
    border-collapse: collapse;
    }

    table.collapse-border td.lineBorder {
    border-bottom: 1px solid #000;
    }


    <table class="collapse-border">
    .....
    .....
    <tr>
    <td class="lineBorder">
    <bean:message key="lbl.confirm"/> <bean:message key="colon"/>
    </td>
    <td class="lineBorder">
    <html:checkbox name="Form1" property="confirm" />
    </td>
    <td></td>
    </tr>
    ..........
    ....
    </table>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles