Generalalign to top in tabular environment next to dashbox

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
exactt
Posts: 3
Joined: Tue Apr 22, 2008 5:47 pm

align to top in tabular environment next to dashbox

Post by exactt »

hi guys,
i have the following code:

Code: Select all

\documentclass[a4paper, 10pt]{letter}
\begin{document}

%blub aligned top
\begin{tabular}{p{1cm} l}
blub & \parbox[t]{10cm}{ some very long multiline text that goes on and on and on and on and on and on and on and on and on and on and on and on }
\end{tabular}

\bigskip
\bigskip
\bigskip

%blub not aligned top
\begin{tabular}[t]{p{1cm} p{10cm}}
blub & \dashbox{0.5}(300,40){
\begin{tabular}{p{9cm}}
some very long multiline text that goes on and on and on and on and on and on and on and on and on and on and on and on \\
\end{tabular}
}  \\
\end{tabular}

\end{document}
now i would like to have "blub" aligned top next to the dashbox just as it is above.

can you help me?

thx a lot!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: align to top in tabular environment next to dashbox

Post by Stefan Kottwitz »

Hi exactt,

welcome to the LaTeX Community board!
I' am wondering at the table with the dashbox. Do you really intend to use a tabular inside the tabular like that? It could be easier to align just parboxes. Afaik the \dashbox command has to be used inside a picture environment, not like this. \fbox and fancybox boxes don't meet your requirements?

Stefan
exactt
Posts: 3
Joined: Tue Apr 22, 2008 5:47 pm

Re: align to top in tabular environment next to dashbox

Post by exactt »

can i get dash lines with fbox/fancybox? i didn't find anything...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

align to top in tabular environment next to dashbox

Post by Stefan Kottwitz »

arydshln would be an alternative approach for dashed lines inside a table. Example:

Code: Select all

\documentclass[a4paper, 10pt]{letter}
\usepackage{arydshln}
\begin{document}
\setlength{\dashlinedash}{0.5pt}
\setlength{\dashlinegap}{0.5pt}
\begin{tabular}[t]{p{1cm}:p{10cm}:}
\cdashline{2-2}
blub & \begin{tabular}[t]{p{9cm}}
some very long multiline text that goes on and on and on and on and on and on and on and on and on and on and on and on \\
\end{tabular}
\\
\cdashline{2-2}
\end{tabular}
\end{document}
Stefan
exactt
Posts: 3
Joined: Tue Apr 22, 2008 5:47 pm

Re: align to top in tabular environment next to dashbox

Post by exactt »

thx guys! with arydshln i could work it out.
Post Reply