Markdown Table Formatting #2103

Closed
opened 2025-12-29 17:22:21 +01:00 by adam · 2 comments
Owner

Originally created by @mdaviesnz on GitHub (Nov 8, 2018).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.4.7

Proposed Functionality

Improve/add formatting of markdown tables in comments fields.

Currently tables from markdown in comment fields appear without formatting and nice spacing making it difficult to read. Applying the already loaded bootstrap CSS style on the table improves this.

Using chrome dev tools I added class="table" to the second table tag for this example:
netbox-table-style

Not sure if it taking the full width of the panel is desirable but this approaches the extent of my CSS knowledge already. There might be a more suitable style in bootstrap and perhaps there's a better way to do this with CSS otherwise?

Use Case

I use tables to document information given by circuit providers which doesn't otherwise go into existing fields on the circuit objects.

Database Changes

N/A

External Dependencies

N/A

Originally created by @mdaviesnz on GitHub (Nov 8, 2018). <!-- NOTE: This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.5.2 * NetBox version: 2.4.7 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Improve/add formatting of markdown tables in comments fields. Currently tables from markdown in comment fields appear without formatting and nice spacing making it difficult to read. Applying the already loaded bootstrap CSS style on the table improves this. Using chrome dev tools I added class="table" to the second table tag for this example: ![netbox-table-style](https://user-images.githubusercontent.com/4390830/48166688-33c06080-e34e-11e8-8752-1bc70adc2207.png) Not sure if it taking the full width of the panel is desirable but this approaches the extent of my CSS knowledge already. There might be a more suitable style in bootstrap and perhaps there's a better way to do this with CSS otherwise? <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case I use tables to document information given by circuit providers which doesn't otherwise go into existing fields on the circuit objects. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes N/A <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies N/A
adam added the type: bugstatus: accepted labels 2025-12-29 17:22:21 +01:00
adam closed this issue 2025-12-29 17:22:21 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 13, 2018):

It seems that Markdown doesn't support table classes, so simply adding class="table" to rendered Markdown won't work. However, we can add a bit of custom CSS to clean things up.

@jeremystretch commented on GitHub (Nov 13, 2018): It seems that Markdown [doesn't support table classes](https://github.com/Python-Markdown/markdown/issues/312), so simply adding `class="table"` to rendered Markdown won't work. However, we can add a bit of custom CSS to clean things up.
Author
Owner

@mdaviesnz commented on GitHub (Nov 20, 2018):

Thanks Jeremy, looks great!

@mdaviesnz commented on GitHub (Nov 20, 2018): Thanks Jeremy, looks great!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2103