fatman fatman - 7 months ago 15
HTML Question

Firefox: remove line around table cell

I have a simple table which allows the user some interactions using the ctrl key.

Everything works fine but on FF, when the the user holds the ctrl and clicks a cell (

<td>
) a blue line is added:

enter image description here

I tried removing it using
outline: 0;
but with no success.

scss:

table {
border-top: 1px solid #cfcfcf;
th {
min-width: 150px;
cursor: pointer;
}
th,
td {
border: 1px solid #cfcfcf;
vertical-align: middle;
outline: 0;
}
}

Answer

Please try this:

table { -moz-user-select: none; }

If the above doesn't workt then try this:

$('table').on('mousedown', function(e) { if (e.ctrlKey) { e.preventDefault(); } });