Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabular environment broken when used with b option. Table with is not respected and vertical centering in cells #114

Open
cjohn001 opened this issue Mar 9, 2023 · 2 comments

Comments

@cjohn001
Copy link

cjohn001 commented Mar 9, 2023

I try to create an html from the following table. I am currently trying to get vertical alignment of text in table cells working and set a fixed table width of 100% or some other fixed value. However, I seem to be not able to get a single table package working
for that.
If I am using >{\centering\arraybackslash}p{0.19\linewidth} -> hence p attribute rather than b, than the total table width is correct. Even so the relative column widths seem to be igrnored. However, for the b attribute (which I need for my setup) even the total table width is not working.

\begin{table}[H]
	\small\centering
	\begin{tabular}{|>{\centering\arraybackslash}b{0.19\linewidth}|>{\raggedright\arraybackslash}b{0.36\linewidth}|>{\raggedright\arraybackslash}b{0.36\linewidth}|}
		\hline
		\multicolumn{1}{|c|}{\textbf{Nutrient}} & \multicolumn{1}{c|}{\textbf{Function}}                 & \multicolumn{1}{c|}{\textbf{Nutrient Source}}                                                                                           \\ \hline
		Vitamin B1                              & precursor for enzymes that help break down blood sugar & yeast, pork, cereal grains, sunflower seeds, brown rice, whole grain rye, asparagus, kale, cauliflower, potatoes, oranges, liver,  eggs \\ \hline
		Vitamin B2                              & supports body cell development and food metabolization & asparagus, bananas, persimmons, okra, chard, cottage cheese, milk, yogurt, meat, eggs, fish, green beans                                \\ \hline
	\end{tabular}
\end{table}

In pdf this results in the following table:

Bildschirm­foto 2023-03-09 um 18 14 36

@michal-h21
Copy link
Owner

I know this question is old. You should get the correct vertical alignment for b columns now:

image

@cjohn001
Copy link
Author

cjohn001 commented Nov 9, 2023

Great!, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants