表格单元格中数学等式的换行符?

表格单元格中数学等式的换行符?

在输入评估的过程中,试图弄清楚如何让方程式在表格环境中发挥作用

\documentclass [11pt] {article}
\usepackage{amsmath}
\usepackage{pdflscape}
\usepackage{float}
\restylefloat{table}
\begin{document}


\title{CSC3407 assessment one }
\author{My name My student number}
\date{09/03/2013}
\maketitle
\tableofcontents
\newpage

\begin{landscape}

\section{Question 3}
Fill the answers in the blanks in the two tables below. You need to provide the working process for each answer.
\subsection{A}
The network mask that supports: 
\begin{table}[H]
    \begin{tabular}{|l|l|l|}
        \hline
       Classful Network & Required borrowed subnet bits & The mask that supports the required subnets \\ \hline
        100.0.0.0 & 12 & 8 bits for class A + 12 bits for subnet = $ 11111111.11111111.11110000.00000000 =1x2^7+1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0= 255$   \\ 

        \hline
    \end{tabular}
\end{table}
\end{landscape}

\end{document}

我需要拆分的等式是 100.0.0.0 & 12 & 8 位(A 类)+ 12 位(子网)= $ 11111111.11111111.11110000.00000000 =1x2^7+1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0= 255$ \

如果我可以让 1x2^7 ... 位于二进制表示之下,那将变得非常好。

例子

11111111.11111111.11110000.00000000
=1x2^7+1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0= 255$

答案1

您可以从aligned以下环境中受益amsmath

\documentclass{article}
\usepackage{amsmath}
\usepackage{pdflscape}

\begin{document}
\begin{landscape}

\section{Question 3}

Fill the answers in the blanks in the two tables below. You need to 
provide the working process for each answer.

\subsection{A}
The network mask that supports:\\[\medskipamount]
\begin{tabular}{|l|l|l|}
\hline
Classful Network & 
  Required borrowed &
  The mask that supports \\
& subnet bits & the required subnets \\ 
\hline
100.0.0.0 & 
  12 &
  8 bits for class A${}+{}$12 bits for subnet%
    $\!\begin{aligned}[t]
    &=\mathtt{11111111.11111111.11110000.00000000} \\
    &=1x2^7+1x2^6+1x2^5+1x2^4+1x2^3\\
    &\qquad{}+1x2^2+1x2^1+1x2^0=255
    \end{aligned}$ \\ 
\hline
\end{tabular}
\end{landscape}

\end{document}

在此处输入图片描述

相关内容