I have created a dark mode TeXworks setup that I really like (and will post as an answer to How can I set a dark theme in TeXworks? when this issue is resolved) but the white preview page is too bright. I have managed to get figure captions to appear in white, text colour to appear in white and the page colour to be black but I am at a loss as to how to change a table (header, lines, data) from all black to all white. I could not see any questions on this but I am happy to be corrected if this is a duplicate. The closest I could find was on How to change the colour of the all lines in tabularx? but this does not change the data or headers.
This is my current dark mode TeXworks setup so you can see the motivation for wanting rough drafts of documents to have black paper/white ink:
On my big monitor, that is too bright for hours of working on documents so I would prefer for it to resemble this (I typically have 3 windows open on the same screen, a main file with arara commands, a .tex file I am working on in the middle that is \included by main and the preview on the right):
What I currently have is this (the table code I copied just for this question from an answer by Mico):
In white it looks like this:
I have stripped most of my formatting code so I know the text doesn't look the best, it is just for the MWE:
\documentclass{article}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage[font={color=white}]{caption} % comment out to revert to normal
\usepackage{tabularx}
\begin{document}
\pagecolor{black} % comment out to revert to normal
\color{white} % comment out to revert to normal
\lipsum[1-2]
\begin{table}
\caption{This text is correctly formatted in white but the table is still in all black.}
\begin{tabularx}{\textwidth}{@{}ccccc@{}}
\hline
movieId & damp_avg_rating & count_r & sum_r & average_r \
\hline
318 & 3.1538461538461537 & 251 & 1107.0 & 4.410358565737051 \
356 & 3.008403361344538 & 257 & 1074.0 & 4.178988326848249 \
2571 & 2.9454545454545453 & 230 & 972.0 & 4.226086956521739 \
\hline
\end{tabularx}
\end{table}
\begin{figure}
\caption{This text is correctly formatted in white.}
\end{figure}
\end{document}
I am not sure how to go about handling this as it appears to be out of my understanding, most table questions on here concern shading or changing \hline colours, not the entire table. I only want this in documents whilst they are rough and in the preview window, the final documents will be in the usual standard white paper and black text.
I do not particularly want to have to edit each tables code, it would be nice if the source could be unchanged in my \include files, a global command or code in the preamble or just after \begin{document} that affects all \begin{table} environments or whatever would be best would be ideal if possible please.




