How to reduce spaces between two rows in table in print format

<style>
.myTable { 
  width: 100%;
  background-color: lemonchiffon !important;
  }

</style>

</head>
<body>
<div class="row">
    <div class="col-xs-12">
	<table class="customer">
	    <tr>
               <td><b>Quotation No</b></td>
               <td>: {{ doc.name or '' }}</td>
            </tr>
           <tr>
               <td><b>Place of Receipt</b></td>
               <td>: {{ doc.name or '' }}</td>
            </tr>
            <tr>
               <td><b>Customer Ref</b></td>
               <td>: {{ doc.name or '' }}</td>
            </tr>
            <tr>
               <td><b>Transit Time</b></td>
               <td>: {{ doc.name or '' }}</td>
            </tr>
            <tr>
               <td><b>Frequency</b></td>
               <td>: {{ doc.name or '' }}</td>
            </tr>
         </table>
     </div>
<!-- HTML -->

<br>
<table class="myTable">
	<tr>
		<th>Header</th>
		<th>Header</th>
	</tr>
	<tr>
		<td>Table cell</td>
		<td>Table cell</td>
	</tr>
	<tr>
		<td>Table cell</td>
		<td>Table cell</td>
	</tr>
</table>

</body>
</html>

I tried border collapse cellsspacing margin botton etc,but not working.please help

1 Like

Wrap the content in a div and set it’s height.


<style>
td div { height: 20px; }
</style>

<table class="myTable">
	<tr>
		<th>Header</th>
		<th>Header</th>
	</tr>
	<tr>
		<td><div>Table cell</div></td>
		<td><div>Table cell</div></td>
	</tr>
	<tr>
		<td><div>Table cell</div></td>
		<td><div>Table cell</div></td>
	</tr>
</table>

Ref: html - How to fix height of TR? - Stack Overflow

2 Likes

Try it through tr css, I use below. Apply class “nospace” to each row

tr.nospace > td
{ 
    padding: 0!important; border-spacing: 0!important;  margin:0!important;
}

Both are working.Thank you