Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery datatables remove horizontal line

Need help, I'm trying to remove the horizontal line in jQuery Datatables.

Please see screenshot below: enter image description here I'm trying to find the line using google chrome element inspector but no luck.

like image 200
Mark Lester Avatar asked Jun 06 '16 11:06

Mark Lester


3 Answers

Those distinct lines is rendered by the <th> elements in <thead> and <tfoot>. Use

table.dataTable thead th {
  border-bottom: 0;
}
table.dataTable tfoot th {
  border-top: 0;
}

...to remove them. Demo -> http://jsfiddle.net/dgsccstp/ try comment out the CSS and re-run.


If you not have specified any footer, ie not having a <tfoot></tfoot> section, remove the bottom line this way :

table.dataTable.no-footer {
  border-bottom: 0;
}

If you have multiple DataTables and only want to remove the borders of one (or more) specific table, replace table with the table #id as selector :

#example1.dataTable thead th {
  border-bottom: 0;
}
#example1.dataTable tfoot th {
  border-top: 0;
}

demo -> http://jsfiddle.net/Ljortyx8/

like image 134
davidkonrad Avatar answered Nov 02 '22 07:11

davidkonrad


I'm not using the tfoot so the dark line at the end of the table is generated in the tbody. I have removed it adding this CSS code:

table.dataTable {
  border-collapse: collapse;
}
like image 39
skeptic Avatar answered Nov 02 '22 07:11

skeptic


it is in css:

table.dataTable.display tbody td

It is the border top:

border-top: 1px solid #ddd;

for each cell.

or only for the header:

in the css:

<thead>
 <th>
  <td>
Td property:
border-bottom: 1px solid #111;

To test it you can uncheck property in css inspector.

for me it works, as you can see: enter image description here

like image 43
Destrif Avatar answered Nov 02 '22 08:11

Destrif