Graphics, Figures & TablesManual resizing and alignment of table cells

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
elodymek
Posts: 2
Joined: Thu Jun 03, 2010 4:20 pm

Manual resizing and alignment of table cells

Post by elodymek »

Hello all, i am new here, i'm from Poland and my english is on level B1, so sorry for each mistake :)

I have big problem with tables. I need to make a table which width is \textwidth and i want to set width of cells manual, no automatically by latex compiler (i use LEd). In fact, i want to set everything manual in my table. Which environment should i use to do what i want?

My actual table looks like this:

Code: Select all

\begin{table}[h!]
\begin{tabular*}{\textwidth}[t]{|*{10}{p{0.1\textwidth}|}}
\hline
\multicolumn{4}{|l}{\tw{Def.} \wyr{($\s$-ciało)} Niech $\X\neq\emptyset,\ \F\subseteq 2^\X$;} & \multicolumn{6}{|l|}{\tw{Tw.} \wyr{($\s$-ciało generowane)} Niech $\X\neq\emptyset,\ \G\subseteq 2^\X$;}\\
\multicolumn{4}{|l}{Rodzinę $\F$ nazywamy \underline{$\s$-ciałem}, jeśli:} & \multicolumn{6}{|l|}{Wówczas istnieje najmniejsze $\s$-ciało $S(\G)$, zawierające $\G$.}\\
\cline{5-10}
\multicolumn{4}{|l}{\mbox{ }\mbox{ }(i) $\emptyset\in\F$} & \multicolumn{6}{|c|}{$S(\G)=\bigcap\{\F$ $|$ $\F$ jest $\s$-ciałem oraz $\G\subseteq\F\}$ --- \textcolor{red}{\bf $\s$-ciało generowane}}\\
\cline{5-10}
\multicolumn{4}{|l|}{\mbox{ }(ii) $A\in\F\Rightarrow\X\backslash A\in\F$} & \multicolumn{6}{c|}{\tw{Ozn.} $\B(\X):=S(\mathcal{O})$ --- \textcolor{red}{\bf rodzina zbiorów borelowskich}}\\
\cline{5-10}
\multicolumn{4}{|l|}{(iii) $\{A_n\}_{n=1}^{\infty}\subseteq\F\Rightarrow\bigcup_{n=1}^{\infty}A_n\in\F$} & \multicolumn{6}{c|}{\tw{Def.} Parę $(\X,\ \F)$ nazywamy \textcolor{red}{\bf przestrzenią mierzalną.}}\\
\hline
\end{tabular*}
\end{table}
Do i wrote this code correctly???

and i want to create then two columns under, each contains 5 columns in size 0.1\textwidth, but i have problem with alignment.
Exactly i wish to for example \multicolumn{5}{|c|}{...} will save size 5*0.1\textwidth and suitable alignment.
Could anyone help me?

P.S. sorry for my english, i used to write in polish.

Hello again,
now i know what i want to do.
I want to set manually the width of column made by instruction \multicolumn{i-j}.
How to do this?

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
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Manual resizing and alignment of table cells

Post by localghost »

You have to provide a minimal working example (MWE) [1]. This is essential because commands like \tw and \wyr are unknown at first sight.

[1] View topic: Avoidable mistakes


Best regards and welcome to the board
Thorsten
elodymek
Posts: 2
Joined: Thu Jun 03, 2010 4:20 pm

Manual resizing and alignment of table cells

Post by elodymek »

Oh, i'm sorry, \wyr and \tw are my own commands.

Thanks for help. I have solved my problem using tabularx environment. Maybe it will be usefull:

Code: Select all

\documentclass[10pt,a4paper]{report}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[cp1250]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\usepackage{anysize}
\marginsize{2cm}{2cm}{2cm}{2cm}
\usepackage{palatino}
\usepackage{tabularx}
\usepackage{color}
\linespread{1.1}
\newcommand{\tw}[1]{\underline{\bf #1}}
\newcommand{\wyr}[1]{\textcolor{red}{\bf #1}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\F}{\mathcal{F}}
\newcommand{\G}{\mathcal{G}}
\newcommand{\X}{\Omega}
\newcommand{\s}{\sigma}
\begin{document}
\noindent{\Large\bf 1. $\s$-ciała zbiorów i przestrzenie mierzalne}
\begin{table}[h!]
\begin{tabularx}{\textwidth}{|*{10}{X|}}
\hline
\multicolumn{4}{|l|}{\tw{Def.} \wyr{($\s$-ciało)} Niech $\X\neq\emptyset,\ \F\subseteq 2^\X$;} & \multicolumn{6}{l|}{\tw{Tw.} \wyr{($\s$-ciało generowane)} Niech $\X\neq\emptyset,\ \G\subseteq 2^\X$. Wówczas istnieje}\\
\multicolumn{4}{|l|}{Rodzinę $\F$ nazywamy \underline{$\s$-ciałem}, jeśli:} & \multicolumn{6}{l|}{najmniejsze $\s$-ciało $S(\G)$, zawierające $\G$.}\\
\cline{5-10}
\multicolumn{4}{|l|}{\mbox{ }\mbox{ }(i) $\emptyset\in\F$} & \multicolumn{6}{c|}{$S(\G)=\bigcap\{\F$ $|$ $\F$ jest $\s$-ciałem oraz $\G\subseteq\F\}$ --- \textcolor{red}{\bf $\s$-ciało generowane}}\\
\cline{5-10}
\multicolumn{4}{|l|}{\mbox{ }(ii) $A\in\F\Rightarrow\X\backslash A\in\F$} & \multicolumn{6}{c|}{\tw{Ozn.} $\B(\X):=S(\mathcal{O}_\X)$ --- \textcolor{red}{\bf rodzina zbiorów borelowskich}}\\
\cline{5-10}
\multicolumn{4}{|l|}{(iii) $\{A_n\}_{n=1}^{\infty}\subseteq\F\Rightarrow\bigcup_{n=1}^{\infty}A_n\in\F$} & \multicolumn{6}{c|}{\tw{Def.} Parę $(\X,\ \F)$ nazywamy \textcolor{red}{\bf przestrzenią mierzalną.}}\\
\hline
\multicolumn{10}{|c|}{Niech $(X, d)$ będzie przestrzenią metryczną; $\mathcal{O}_X$ --- zbiory otwarte, $\F_X$ --- zbiory domknięte.}\\
\hline
\multicolumn{5}{|X|}{\tw{Def.} \wyr{(zbiór typu $F_\sigma$)} $A\subset X$ jest typu $F_\sigma$, ozn. $A\in F_\sigma (X)$, jeśli:$$\exists_{\{F_n\}_{n\in\mathbb{N}}\subseteq\F_X}A=\bigcup_{n=1}^{\infty}F_n$$} & \multicolumn{5}{X|}{\tw{Def.} \wyr{(zbiór typu $G_\delta$)} $A\subset X$ jest typu $G_\delta$, ozn. $A\in G_\delta (X)$, jeśli:$$\exists_{\{G_n\}_{n\in\mathbb{N}}\subseteq\mathcal{0}_X}A=\bigcap_{n=1}^{\infty}G_n$$}\\
\hline
\end{tabularx}
\end{table}
\end{document}

Post Reply