\documentclass[10pt]{article}
\newlength\replength
\newcommand\repfrac{.33}
\newcommand\dashfrac[1]{\renewcommand\repfrac{#1}}
\setlength\replength{1.5pt}
\newcommand\rulewidth{.6pt}
\newcommand\tdashfill[1][\repfrac]{\cleaders\hbox to \replength{%
\smash{\rule[\arraystretch\ht\strutbox]{\repfrac\replength}{\rulewidth}}}\hfill}
\newcommand\tabdashline{%
\makebox[0pt][r]{\makebox[\tabcolsep]{\tdashfill\hfil}}\tdashfill\hfil%
\makebox[0pt][l]{\makebox[\tabcolsep]{\tdashfill\hfil}}%
\\[-\arraystretch\dimexpr\ht\strutbox+\dp\strutbox\relax]%
}
\newcommand\tdotfill[1][\repfrac]{\cleaders\hbox to \replength{%
\smash{\raisebox{\arraystretch\dimexpr\ht\strutbox-.1ex\relax}{.}}}\hfill}
\newcommand\tabdotline{%
\makebox[0pt][r]{\makebox[\tabcolsep]{\tdotfill\hfil}}\tdotfill\hfil%
\makebox[0pt][l]{\makebox[\tabcolsep]{\tdotfill\hfil}}%
\\[-\arraystretch\dimexpr\ht\strutbox+\dp\strutbox\relax]%
}
\begin{document}
Por\'ownanie: tabdashline do tabdotline oraz do hline\\[1mm]
\begin{tabular}{|c|}
\hline
g\'ora\\
\tabdashline
d\'o\l\\
\hline
\end{tabular}
vs.
\begin{tabular}{|c|}
\hline
g\'ora\\
\tabdotline
d\'o\l\\
\hline
\end{tabular}
vs.
\begin{tabular}{|c|}
\hline
g\'ora\\
\hline
d\'o\l\\
\hline
\end{tabular}\\[2mm]
wyr\'ownanie wielu kolumn, ~r\'o\.zne linie poziome\\[1mm]
\begin{tabular}{|c|c|}
\hline
g\'ora & column with 0.7 dashfrac\\
\tabdashline & \replength=.4ex\relax\dashfrac{0.7}\tabdashline
d\'o\l & and a replength of .4ex\\
\hline
\end{tabular}\\[2mm]
Z arraystretch warto\'sci 1.3:\\[1mm]
\def\arraystretch{1.3}
\begin{tabular}{|c|}
\hline
top\\
\tabdashline
d\'o\l\\
\hline
\end{tabular}
vs.
\begin{tabular}{|c|}
\hline
top\\
\hline
d\'o\l\\
\hline
\end{tabular}
\end{document}
|
|