Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I recently discovered the less known cals package for defining tables HTML-style.

Here is all documentation I found:

I can create nice tables but following the directions to delete vertical cell borders does not work. Can anybody help?

Here is a working example:

\documentclass{report}
\listfiles

%tables in CALS markup
\usepackage{cals}

%calculate with \textwidth etc.
\usepackage{calc}
\newlength{\lengthw}

\begin{document}    
\setlength{\lengthw}{\textwidth-5cm}
\begin{table}[ht]
\caption{Aantal uitgangen}
\begin{calstable}
\colwidths{{\lengthw}{5cm}}

\def\cals@cs@width{0pt} %this should delete column borders but is does not!

\thead{
\brow 
\alignL\cell{} \alignC\cell{\vfil Aantal uitgangen}\erow
    }   
\brow
    \alignL\cell{\vfil$aantal\ gebruikers < 50$}
    \alignC\cell{\vfil 1 of 2 uitgangen (cfr. 7.1.2)}
\erow
\brow
    \alignL\cell{\vfil$50 \leq aantal\ gebruikers < 500$}
    \alignC\cell{\vfil 2}
\erow
\brow
    \alignL\cell{\vfil$500 \leq aantal\ gebruikers < 1000$}
    \alignC\cell{\vfil 3}
\erow
\brow
    \alignL\cell{\vfil $1000 \times n \leq aantal\ gebruikers < 1000 \times (n+1)$
    \\met $n = 1, 2, 3, \dots$}
    \alignC\cell{\vfil$n+3$}
\erow
\end{calstable}
\end{table} 
\end{document}
share|improve this question
    
Welcome to TeX.SX. –  Claudio Fiandrino Feb 22 '13 at 19:26

2 Answers 2

up vote 6 down vote accepted

Because the macro \cals@cs@width has the character @ in its name, you need to enclose the part where you use it with \makeatletter and \makeatother. (→ What do \makeatletter and \makeatother do?)

\makeatletter
\def\cals@cs@width{0pt}%
\makeatother

If you use this in the preamble (after loading the cals package) of your document, you won’t need to repeat it every time.

If you want to decide for every table whether you want vertical rules (I’d advise against it), you are better off using an @-less macro that you also define in the preamble of your document.

\makeatletter
\newcommand*{\calsNoVertRules}{%
    \renewcommand*{\cals@cs@width}{0pt}%
}
\makeatother

Now you can simply use \calsNoVertRules to switch vertical rules off.

share|improve this answer
    
This indeed did the trick! Many thanks for the very instructive answer. Hoping to see more cals package users here. –  Serge Stroobandt Feb 22 '13 at 19:21
\documentclass{report}
\listfiles

%tables in CALS markup
\usepackage{cals}

%calculate with \textwidth etc.
\usepackage{calc}
\newlength{\lengthw}

%my suggestion
\makeatletter

\begin{document}    
\setlength{\lengthw}{\textwidth-5cm}
\begin{table}[ht]
\caption{Aantal uitgangen}
\begin{calstable}
\colwidths{{\lengthw}{5cm}}

%\def\cals@cs@width{0pt} %this should delete column borders but is does not!

\thead{
%my suggestion
%\def\cals@borderT{0.4pt} %borderTop
%\def\cals@borderB{0.4pt} %borderBottom
%\def\cals@borderL{0pt}   %borderLeft
\def\cals@borderR{0pt}    %borderRight
\brow 
\alignL\cell{} \alignC\cell{\vfil Aantal uitgangen}\erow
    }   
\brow
    \alignL\cell{\vfil$aantal\ gebruikers < 50$}
    \alignC\cell{\vfil 1 of 2 uitgangen (cfr. 7.1.2)}
\erow
\brow
    \alignL\cell{\vfil$50 \leq aantal\ gebruikers < 500$}
    \alignC\cell{\vfil 2}
\erow
\brow
    \alignL\cell{\vfil$500 \leq aantal\ gebruikers < 1000$}
    \alignC\cell{\vfil 3}
\erow
\brow
    \alignL\cell{\vfil $1000 \times n \leq aantal\ gebruikers < 1000 \times (n+1)$
    \\met $n = 1, 2, 3, \dots$}
    \alignC\cell{\vfil$n+3$}
\erow
\end{calstable}
\end{table} 
\end{document}
share|improve this answer
    
In order to improve your answer, you may want to show how your solution works with a complete document. Usually, this makes clear to the reader how to proceed. –  Claudio Fiandrino Jan 28 at 14:55
    
Sorry, I'm a beginner :) –  Attila Kosa Jan 28 at 14:57
    
No problems at all :) If you improve your answer, I'll be very happy to upvote it. –  Claudio Fiandrino Jan 28 at 14:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.