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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
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: 10360
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