Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2022, 07:32 AM   #1
01100001
Enthusiast
01100001 began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Sep 2022
Device: Microsoft Surface Pro 7, Apple iPad
Question How to style (CSS) Custom columns/fields in Book details pane? What are their IDs?

Under Preferences > Look & feel > Book details > Text styling it appears you can style the content shown in the Book details pane.

This is what I am referring to:

Click image for larger version

Name:	Book details pane.png
Views:	100
Size:	572.3 KB
ID:	196575

I am looking to style a custom column/field and its content in the Book details pane (called Filenames2 (#filenames2)). It looks like this (and is based on the help received from our members here):

Click image for larger version

Name:	Book details pane custom field.png
Views:	96
Size:	23.9 KB
ID:	196576

But I don't know what their HTML ID attribute values are so I can use them and style them using CSS. Also, I cannot be sure what their HTML markup looks like.

I tried a couple, and neither is working:

Code:
#_filenames2 ul,
#_filenames2 ul li {
    padding-left: 0;
    margin-left: 0;
    text-indent: 0;
}

#_filenames2 li {
    user-select: all;
}
Code:
ul,
ul li {
    padding-left: 0;
    margin-left: 0;
    text-indent: 0;
}

li {
    user-select: all;
}
Question: What am I missing here? Also, is there any way to view the markup of the actual fields and their values being shown in the Book details pane? (I know there's a partial example shown in the Preferences > Look & feel > Book details > Text styling field.)

Last edited by 01100001; 09-16-2022 at 07:35 AM.
01100001 is offline   Reply With Quote
Old 09-16-2022, 07:43 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The example tell you everything you need to know. The ids for custom columns are underscore + field name. And classes are based on column datatypes.

I suggest you first try styling a simple custom column.
kovidgoyal is offline   Reply With Quote
Old 09-16-2022, 09:56 AM   #3
01100001
Enthusiast
01100001 began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Sep 2022
Device: Microsoft Surface Pro 7, Apple iPad
Thumbs up

So what I was already doing (as seen in the first example). It wasn't working because Calibre uses QT-specific CSS property for indentation -qt-list-indent.

Thanks to this link @kovidgoyal had shared in an older post showing all supported HTML Tags & Attributes and CSS Properties & Selectors: https://doc.qt.io/qt-5/richtext-html-subset.html

That clears things up. I will have to find some other way to sort my issues.

Thank you!

Edit to clarify: The CSS property user-select isn't supported.

Last edited by 01100001; 09-16-2022 at 10:00 AM. Reason: clarification
01100001 is offline   Reply With Quote
Old 09-16-2022, 10:56 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by 01100001 View Post
So what I was already doing (as seen in the first example). It wasn't working because Calibre uses QT-specific CSS property for indentation -qt-list-indent.

Thanks to this link @kovidgoyal had shared in an older post showing all supported HTML Tags & Attributes and CSS Properties & Selectors: https://doc.qt.io/qt-5/richtext-html-subset.html

That clears things up. I will have to find some other way to sort my issues.

Thank you!

Edit to clarify: The CSS property user-select isn't supported.
Having failed with CSS I made it work using a table instead of an unordered list.
Code:
program:
	j = '';
	for i in $tags:
		j = j & '<tr><td>&bull;</td><td><a href="' & re(i, '"', '&quot;') & '">' & i & '</a></td></tr>'
	rof;
	if j then '<table>' & j & '</table>'else '' fi;
EDIT: Forgot the </tr> on the original template. Corrected.
Attached Thumbnails
Click image for larger version

Name:	Clipboard02.jpg
Views:	69
Size:	15.6 KB
ID:	196579  

Last edited by chaley; 09-16-2022 at 11:09 AM. Reason: Forgot the </tr> on the original template. Corrected.
chaley is offline   Reply With Quote
Old 09-16-2022, 11:06 AM   #5
01100001
Enthusiast
01100001 began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Sep 2022
Device: Microsoft Surface Pro 7, Apple iPad
Ha, good idea! Thanks!
01100001 is offline   Reply With Quote
Reply

Tags
caibre, calibre 6.4, css, custom columns, look & feel


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Columns edit fields bgaugler Library Management 8 03-29-2019 11:00 PM
Book Details Pane Missing RainIntoRainbows Calibre 3 08-15-2018 02:41 AM
book details pane tracis035 Calibre 7 11-04-2016 12:00 AM
Custom Column (Synopsis) shows in Book Details Pane! Great! 1611mac Library Management 0 06-07-2011 12:37 PM


All times are GMT -4. The time now is 05:24 AM.


MobileRead.com is a privately owned, operated and funded community.