Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add horizontal line in a table?

Tags:

html

css

Following is the code of table :

<table cellpadding="0" cellspacing="" width="100%" border="0">   <tbody>     <tr class="pack_list_divider">       <td width="30%" rowspan="2">         <img id="coursimg" src="test_listings_files/default_package_image.png" alt="Section wise test" border="0">       </td>       <td width="25%">         <p class="pckgvalidity">           Validity : 1 Year&nbsp;         </p>       </td>       <td width="35%">         <p class="pckgvalidity">Number of Tests : 0         </p>       </td>       <td width="20%" valign="middle">         <!--<p id="test_list_loader" height="20" align="center" style="display:none;"></p> -->         <a href="http://localhost/abc/pqr/lmn/web/online-test-packages?op=get_package_detail&amp;test_pack_id=21e86b3ebf6a8af2a9fcf136c4f8e88a" class="view_test_package_details">Test Details</a>       </td>     </tr>     <tr>       <td colspan="2" width="50%" valign="top">         <p class="descp">           sectionm wise tests         </p>       </td>       <td width="20%">         <p class="pckgrs"> <span class="rs fl" style="color:#333333; font:25px bold; margin:0px 0px 10px 10px;"> Free &nbsp; </span>           <span>             <a class="user-not-loggedin more addcart fl" href="http://localhost/entrance_prime/Entrance_Prime/entprm/web/my_cart.php?pack_id=21e86b3ebf6a8af2a9fcf136c4f8e88a&amp;pack_type=test&amp;op=aa" id="21e86b3ebf6a8af2a9fcf136c4f8e88a" value="21e86b3ebf6a8af2a9fcf136c4f8e88a" style="background:url(../images_new/add_account.png) 0 0 no-repeat;">&nbsp;</a>                         </span>         </p>       </td>     </tr>   </tbody> </table>

I want a horizontal line in between the rows. I've tried so many tricks but none of them did the magic for me. Can anyone help me in resolving this issue? Thanks in advance.

like image 536
PHPLover Avatar asked Jun 18 '13 12:06

PHPLover


People also ask

How do I insert a horizontal line in a table?

Simply use the <hr> tag to create a horizontal line.

How do I add a line in HTML table?

Adding the Horizontal Line using <hr> tag: The Horizontal Rule tag (<hr>) is used for the purpose of inserting horizontal lines in the HTML document in order to separate sections of the document. It is an empty or unpaired tag that means there is no need for the closing tag.


1 Answers

I use this trick:

<table>    <tr style="border-bottom:1px solid black">      <td colspan="100%"></td>    </tr>    <tr> ... </tr>  </table>
like image 196
PhatHV Avatar answered Oct 07 '22 04:10

PhatHV