From 4c677e7fe62ed387c11f182634824468c8976c8e Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 7 Oct 2019 17:22:35 -0400 Subject: [PATCH] Force checkbox table columns to narrow width --- netbox/project-static/css/base.css | 3 +++ netbox/utilities/tables.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/netbox/project-static/css/base.css b/netbox/project-static/css/base.css index d37a2106e..6ae37bdf1 100644 --- a/netbox/project-static/css/base.css +++ b/netbox/project-static/css/base.css @@ -149,6 +149,9 @@ table.attr-table td:nth-child(1) { .table-headings th { background-color: #f5f5f5; } +td.min-width { + width: 1%; +} /* Paginator */ div.paginator { diff --git a/netbox/utilities/tables.py b/netbox/utilities/tables.py index 3564136ac..9e91aebd2 100644 --- a/netbox/utilities/tables.py +++ b/netbox/utilities/tables.py @@ -26,6 +26,12 @@ class ToggleColumn(tables.CheckBoxColumn): def __init__(self, *args, **kwargs): default = kwargs.pop('default', '') visible = kwargs.pop('visible', False) + if 'attrs' not in kwargs: + kwargs['attrs'] = { + 'td': { + 'class': 'min-width' + } + } super().__init__(*args, default=default, visible=visible, **kwargs) @property