How to change default font in table view in knime

Hello
Please teach me how to change the fonts of table view in knime.

Hello @alex1368,

You can use the CSS editor and the Table View (JavaScript) node to change the CSS of the table view.

For your reference, I have attached an image.

Screenshot 2024-04-08 144710

4 Likes

I used this node, but I did not get the desired output
Does it have special settings?
For example, I increased the foot size, but the output did not change
Please guide me further

Hi @alex1368, the help documentation for the Table View (javascript) node points at some old documentation but I believe it is still relevant.

The various css classes are listed in this document. I couldn’t find a newer version than this, and as I discovered, there is some trial-and-error but hopefully this will get you started:
https://docs.knime.com/2021-12/analytics_platform_css_guide/index.html

Within the css editor, press Ctrl Space (and presumably equivalent in other OS, such as Cmd Space on Mac) to bring up a list of known classes.

The CSS Editor creates a flow variable.

You need to configure the Table View (JavaScript) node to use that flow variable in the “customCSS” setting in the flow variable config, to use that same flow variable created by the CSS Editor.

Once that’s done, with CSS such as this:

.knime-table-cell {
	font-family: cursive;
	font-size: 10pt;
	font-weight: bold;
	color: gold;
	background-color: black;

}

.knime-table-header {
	font-size: 30pt;
	font-weight: bold;
	color: cyan;
	background-color: blue;
}

… you get this when you use “Open View” on the Table View (JavaScript) node:

If this resolves your question, please mark @tqAkshay95 's earlier response as the solution.

6 Likes

Owww.

This is veryyyyyy… interesting.

(saving for later)

@takbb

“Is it possible to edit the font of the ‘Table View’ node (not JavaScript table view)?”
Because, “table view” (normal) has not varibles configuration.

image

1 Like

Hi @Felipereis50 , I don’t know of a way.

It works for the javascript version because that provides a flow variable configuration “customCSS” that can accept a stylesheet, but there isn’t such an option on the regular Table View.

Thanks for the information.

I used it in both cases, but still the output I wanted was not obtained!!!