-
2021-04-19 07:01:15
我们所用的宏包为colortbl,这个宏包可以设置表格中数据、文本、行、列、单元格前景和背景以及边框的颜色,从而得到彩色表格。同时需要 array 和 color 两个宏包的支持。 宏包提供了一组着色命令,经常用到是列着色命令,其格式为:
\columncolor[色系]{色名}[左伸出][右伸出]。
常用色系有三原色 rgb 灰度 gray 和四色cmyk三种;被预定义的色名有68个,详见 color 宏包介绍中所附的色标;左右伸出的长度单位可用 pt。
colortbl 的主要命令
命令
作用
\columncolor
让整个字段着色
\rowcolor
整个横列着色
\arrayrulecolor{颜色}
指定线条的颜色
\doublerulesepcolor{颜色}
指定双线内间隔的颜色
在这里,\columncolor 和 \rowcolor 的参数是一样的,他们的共同语法是:
\columncolor[颜色模型]{颜色}[左伸出长度][右伸出长度]
我们现在就来看个实例,这里头有些例子,包括:灰阶横条、部份字段着色、整个表格在着色背景及单一个表格内方框着色:
示例代码如下:
\documentclass[16px]{article}
\usepackage{textcomp,booktabs}
\usepackage[usenames,dvipsnames]{color}
\usepackage{colortbl}
\definecolor{mygray}{gray}{.9}
\definecolor{mypink}{rgb}{.99,.91,.95}
\definecolor{mycyan}{cmyk}{.3,0,0,0}
\parindent=0
\parskip=3ex
\begin{document}
\centering
\section*{SPECIFIC HEATS (20 \textcelsius\ AND 1 ATM)}
\begin{tabular}{>{\sf }lll} %
\toprule
& \multicolumn{2}{c}{\bf Specific Heats} \\
\cmidrule{2-3}
& $c$ (J/kg$\cdot$K) & $C$ (J/mol$\cdot$K) \\
\midrule
Aluminum & 900 & 24.3 \\
\rowcolor{mygray}
Copper & 385 & 24.4 \\
Gold & 130 & 25.6 \\
\rowcolor{mygray}
Steel/Iron & 450 & 25.0 \\
Lead & 130 & 26.8 \\
\rowcolor{mygray}
Mercury & 140 & 28.0 \\
Water & 4190 & 75.4 \\
\rowcolor{mygray}
Ice ($-$10 \textcelsius) & 2100 & 38 \\
\bottomrule
\end{tabular}
\vspace{8ex} %
\section*{SPECIFIC HEATS (20 \textcelsius\ AND 1 ATM)}
\begin{tabular}{>{\columncolor{mypink}\sf }lll@{}}
\toprule
\rowcolor{white}
& \multicolumn{2}{c}{\bf Specific Heats} \\
\cmidrule{2-3}
\rowcolor{white}
& $c$ (J/kg$\cdot$K) & $C$ (J/mol$\cdot$K) \\
\midrule
Aluminum & 900 & 24.3 \\
Copper & 385 & 24.4 \\
Gold & 130 & 25.6 \\
Steel/Iron & 450 & 25.0 \\
Lead & 130 & 26.8 \\
Mercury & 140 & 28.0 \\
Water & 4190 & 75.4 \\
Ice ($-$10 \textcelsius) & 2100 & 38 \\
\bottomrule
\end{tabular}
\section*{SPECIFIC HEATS (20 \textcelsius\ AND 1 ATM)}
\fboxsep=16px
\colorbox{mypink}{
\begin{tabular}{@{}>{\sf }lll@{}}
\toprule
& \multicolumn{2}{c}{\bf Specific Heats} \\
\cmidrule{2-3}
& $c$ (J/kg$\cdot$K) & $C$ (J/mol$\cdot$K) \\
\midrule
Aluminum & 900 & 24.3 \\
Copper & 385 & 24.4 \\
Gold & 130 & 25.6 \\
Steel/Iron & 450 & 25.0 \\
Lead & 130 & 26.8 \\
Mercury & 140 & 28.0 \\
Water & 4190 & 75.4 \\
Ice ($-$10 \textcelsius) & 2100 & 38 \\
\bottomrule
\end{tabular}}
\vspace{8ex} %
\section*{SPECIFIC HEATS (20 \textcelsius\ AND 1 ATM)}
\begin{tabular}{@{}>{\sf }lll@{}}
\toprule
& \multicolumn{2}{c}{\bf Specific Heats} \\
\cmidrule{2-3}
& $c$ (J/kg$\cdot$K) & $C$ (J/mol$\cdot$K) \\
\midrule
Aluminum & 900 & 24.3 \\
Copper & 385 & 24.4 \\
Gold & 130 & 25.6 \\
Steel/Iron & 450 & 25.0 \\
Lead & 130 & 26.8 \\
Mercury & 140 & 28.0 \\
Water & \multicolumn{1}{>{\columncolor{mycyan}}l}{4190} & 75.4 \\
Ice ($-$10 \textcelsius) & 2100 & 38 \\
\bottomrule
\end{tabular}
\setlength{\extrarowheight}{2mm}
\begin{tabular}{|l|c|c|c|c|c|c|c|}
\hline
Sydney & OG4G &Thu Oct 10 &Mon Oct 21 or 28 &11 or 18 days &999\\
\rowcolor[gray]{0.5}
& &Thu Oct 17 &Mon Oct 21 or 28 & 4 or 11 days &999\\
&OG7A &Sun Oct 13 &Mon Oct 21 or 28 & 8 or 15 days &999\\
\rowcolor[gray]{0.5}
& &Sun Oct 20 &Mon Oct 28 & 8 days &999\\
\hline
\end{tabular}
\setlength{\extrarowheight}{2mm}
\setlength{\tabcolsep}{2mm}
\begin{tabular}{|l|%
>{\columncolor{yellow}}c|c|>{\columncolor{yellow}}c|c|%
>{\columncolor{red}\bfseries}c
\hline
\multicolumn{3}{>{\columncolor{red}}l}{\color{white}\textsf{LONDON}}
&\multicolumn{3}{>{\columncolor{red}}r}{\color{white}\textsf{Price}}
\\[1px]
\hline
Sydney & OG4G &Thu Oct 10 &Mon Oct 21 or 28 &11 or 18 days &999\\
& &Thu Oct 17 &Mon Oct 21 or 28 & 4 or 11 days &999\\
& OG7A &Sun Oct 13 &Mon Oct 21 or 28 & 8 or 15 days &999\\
& &Sun Oct 20 &Mon Oct 28 & 8 days &999\\
\hline
\end{tabular}
\setlength{\arrayrulewidth}{3px}
\arrayrulecolor{green}
\begin{tabular}{|l|c|r|}
\arrayrulecolor{black}\hline
United Kingdom & London & Thames\\
\arrayrulecolor{blue}\hline
France & Paris & Seine \\
\arrayrulecolor{black}\cline{1-1}
\arrayrulecolor{red}\cline{2-3}
Russia & Moscow & Moskva \\ \hline
\end{tabular}
\end{document}
更多相关内容 -
pytorch_tabular:用于对表格数据的深度学习模型进行建模的标准框架
2021-04-30 10:25:07PyTorch Tabular旨在使利用Tabular数据进行的深度学习变得容易,并且现实世界中的案例和研究都可以访问。 库设计背后的核心原则是: 低电阻可用性 轻松定制 可扩展且易于部署 它建立在PyTorch (显然)和PyTorch ... -
Kaggle-Tabular_Playground_Series_Feb_2021:根据数据中提供的多个特征列预测连续目标。 所有要素列cat0-...
2021-02-17 10:04:56Kaggle-Tabular_Playground_Series_Feb_2021 目标是根据数据中提供的多个特征列预测连续目标。 所有要素列cat0-cat9是分类的,要素列cont0-cont13是连续的。 该比赛使用的数据集是合成的,但基于真实数据集并使用... -
Python库 | tabular_automl-0.1.0-py3-none-any.whl
2022-04-26 15:32:27资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:tabular_automl-0.1.0-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059 -
Tabular表达式的指称语义研究
2021-03-04 06:30:55Tabular表达式的指称语义研究 -
表格式的「tabular」-crx插件
2021-03-14 07:56:26当用户打开太多的标签页时,要对用户进行打包 讽刺而又刻薄的提醒您,您可能使用了太多的Chrome标签。 更新:在所有窗口中计数标签,而不仅仅是主窗口。 :D 支持语言:English -
RL-tabular-solution-methods:表格形式的强化学习算法
2021-04-06 15:51:44RL表格解决方法 表格形式的强化学习算法。 -
Tabular技术
2018-05-28 15:10:00SSAS分析服务,讲解cube,适合excel分析数据。适合小型Cube -
DAX in the BI Tabular Model.pdf
2020-02-29 14:04:35dax官方白皮书 全英文 原汁原味 dax官方白皮书 全英文 原汁原味 dax官方白皮书 全英文 原汁原味 -
PB自动美化grid风格的dw(grid自动转成tabular)
2017-03-20 13:21:42自动把 grid风格的数据窗口转成 tabular分割, 自动画线,线的颜色可以修改 , 支持列宽拖动,支持多表头 -
deep_learning_for_tabular_data:概念性展示和数据生成器使TensorFlow和Keras的表格数据更易于使用
2021-05-25 03:31:29deep_learning_for_tabular_data 深度学习还可用于基于表格数据的预测,表格数据是您最常在数据库和表中找到的数据。 在本研讨会的演示会议上,将讨论这种方法的工作原理,以及它在更流行的机器学习算法(例如梯度... -
Kaggel-Tabular-Playground-Series-2021:我对2021年Kaggle表格游乐场比赛的参与代码
2021-02-24 19:15:24Kaggel-Tabular-Playground-Series-2021:我对2021年Kaggle表格游乐场比赛的参与代码 -
DCNN-for-Tabular-data:DCNN对表格数据进行预测
2021-04-10 03:54:12DCNN用于表格数据 这项工作展示了我们在雷德黑德莱克黑德大学数据科学硕士课程的顶峰项目。 该项目使用不同大小范围的表格数据集,包括Connect4,Covertype,EEG,Letter识别,Hepmass-OS,Hepmass-NS,Hepmass-AS和... -
DAT225x-SSAS_Tabular:edX课程DAT225x的课程文件开发SQL Server Analysis Services表格模型
2021-04-29 05:20:00DAT225x-SSAS_Tabular edX课程DAT225x的课程文件开发SQL Server Analysis Services表格模型 -
meteor-tabular, 针对大型或者小型数据集的反应性数据表.zip
2019-09-18 06:34:45meteor-tabular, 针对大型或者小型数据集的反应性数据表 aldeed:tabular在高效的方式下创建反应性的 datatable插件,允许你在不影响应用程序性能的情况下显示巨大集合的内容。 table-内容使用 DocToc 生成的内容 表... -
Python-meza处理表格tabular数据的Python工具集
2019-08-10 03:38:47meza 是个 Python 库, 专门读取和处理表格数据 ; 函式型接口,擅长读写大文件, 并支持十数种文件格式 -
tabular:表格简化了从命令行实用程序打印ASCII表的过程
2021-05-19 07:40:17并且可以在tabular.Print()或tabular.Parse()调用期间指定列的子集,以修改表的标题而不重新定义它。 示例(在也可用): package main import ( "fmt" "log" "github.com/InVisionApp/tabular" ) var tab ... -
Tabular-crx插件
2021-03-24 07:00:43Tabular是一个浏览器扩展,适用于总是打开许多选项卡的人们。 -点击该按钮可在一个易于阅读的表格中查看所有打开的标签页的列表。 -排序并搜索以查找所需的标签。 -使用“书签”和“关闭”按钮来整理和清理打开的... -
tabular-metadata:SIdora的CSV元数据生成组件
2021-04-30 04:43:42构建:克隆后,执行cd tabular-metadata ,然后执行mvn clean install 。 要运行独立的Web服务,请使用cd tabular-metadata-webapp和mvn jetty:run 。 这将在http://localhost:8080运行该应用程序。 只有一种使用... -
Kaggle Tabular Playground Series - Jan 2022 学习笔记1(数据分析)
2022-04-22 16:07:35Kaggle Tabular Playground Series - Jan 2022 学习笔记1(数据分析) 详情参考:Tabular Playground Series - Jan 2022 简介:给出了两家商店在三个国家在2015年-2018年的三种产品的每天的销售量,要求预测2019年的...试题地址:Tabular Playground Series - Jan 2022
简介:给出了两家商店在三个国家在2015年-2018年的三种产品的每天的销售量,要求预测2019年的销售量。
本文参考 TPSFEB22-01 EDA which makes sense
import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates
读取数据
train_data=pd.read_csv('../datas/train.csv') test_data=pd.read_csv('../datas/test.csv') for df in [train_data, test_data]: df['date'] = pd.to_datetime(df.date) df.set_index('date', inplace=True, drop=False) # Shape and preview print('Training data df shape:',train_data.shape) print('Test data df shape:',test_data.shape) train_data.head()
查看有无缺失值print('Number of missing values in training set:',train_data.isna().sum().sum()) print('') print('Number of missing values in test set:',test_data.isna().sum().sum())
查看数据成分print('Training cardinalities: \n', train_data.nunique()) print('') print('Test cardinalities: \n', test_data.nunique())
查看日期范围print('Training data:') print('Min date', train_data['date'].min()) print('Max date', train_data['date'].max()) print('') print('Test data:') print('Min date', test_data['date'].min()) print('Max date', test_data['date'].max())
综上,我们可以发现:有三个国家,两个商店和三种产品,这样就会有18种组合。训练数据涵盖2015 - 2018年,测试数据要求我们预测2019年。训练数据和测试数据均无缺失值。来看看每个组合销售量的图
plt.figure(figsize=(18, 15)) for i, (combi, df) in enumerate(train_data.groupby(['country', 'store', 'product'])): # df = df.set_index('date') # print(df.index) # break ax = plt.subplot(6, 3, i+1, ymargin=0.5) ax.plot(df.index,df.num_sold) ax.set_title(combi) ax.xaxis.set_major_locator(mdates.YearLocator()) ax.xaxis.set_major_formatter(mdates.DateFormatter('%y/%m/%d')) ax.xaxis.set_minor_locator(mdates.MonthLocator()) plt.tight_layout(h_pad=3.0) plt.suptitle('Daily sales for 2015-2018', y=1.03) plt.show()
从上图中可以发现每年年底每种产品的销售量远高于平常,可能需要将每年年底的日期单独提取出来作为特征。同时可以发现Kaggle Hat 和Kaggle Mug似乎具有季节性特征,考虑增加傅里叶特征。plt.figure(figsize=(18, 20)) for i, (combi, df) in enumerate(train_data.groupby(['country', 'store', 'product'])): ax = plt.subplot(6, 3, i+1, ymargin=0.5) resampled = df.resample('MS').sum() for m, (combm, dfm) in enumerate(resampled.groupby(resampled.index.year)): # print(dfm) ax.plot(range(1 , 13) , dfm.num_sold, label=combm ) # break # resampled = resampled.groupby(resampled.index.year) # break # ax.plot(range(1, 13), resampled.num_sold) ax.legend() ax.set_xticks(ticks=range(1, 13)) # ax.set_xticklabels('JFMAMJJASOND') ax.set_title(combi) # ax.set_ylim(resampled.num_sold.min(), resampled.num_sold.max()) plt.suptitle('Monthly sales for 2015-2018', y=1.03) plt.tight_layout(h_pad=3.0) plt.show()
可以发现每年每月的波动很相似。同时,销售趋势并不是逐年递增,最明显的是挪威2016年的每月的销售量会低于2015年!所以可能还受其他因素的影响。接下来看看每周是否有季节性特征
plt.figure(figsize=(18, 12)) for i, (combi, df) in enumerate(train_data.groupby(['country', 'store', 'product'])): ax = plt.subplot(6, 3, i+1, ymargin=0.5) #计算每周每天销售的平均值 resampled = df.groupby(df.index.dayofweek).mean() ax.bar(range(7), resampled.num_sold, color=['b']*4 + ['g'] + ['orange']*2) ax.set_title(combi) ax.set_xticks(range(7)) ax.set_xticklabels(['M', 'T', 'W', 'T', 'F', 'S', 'S']) ax.set_ylim(0, resampled.num_sold.max()) plt.suptitle('Sales per day of the week', y=1.03) plt.tight_layout(h_pad=3.0) plt.show()
可以发现一到了周末销量会有明显的升高,考虑增加每周的季节性指示器(Seasonal indicators)接下来看看12月和1月的销量统计
plt.figure(figsize=(18, 12)) for i, (combi, df) in enumerate(train_data.groupby(['country', 'store', 'product'])): ax = plt.subplot(6, 3, i+1, ymargin=0.5) ax.bar(range(1, 32), df.num_sold[df.date.dt.month==12].groupby(df.date.dt.day).mean(), color=['b'] * 25 + ['orange'] * 6) ax.set_title(combi) ax.set_xticks(ticks=range(5, 31, 5)) plt.tight_layout(h_pad=3.0) plt.suptitle('Daily sales for December', y=1.03) plt.show()
plt.figure(figsize=(18, 12)) for i, (combi, df) in enumerate(train_data.groupby(['country', 'store', 'product'])): ax = plt.subplot(6, 3, i+1, ymargin=0.5) ax.bar(range(1, 32), df.num_sold[df.date.dt.month==1].groupby(df.date.dt.day).mean(), color=['b'] * 5 + ['orange'] * 26) ax.set_title(combi) ax.set_xticks(ticks=range(5, 31, 5)) plt.tight_layout(h_pad=3.0) plt.suptitle('Daily sales for December', y=1.03) plt.show()
可以看出,大约12月25日销量开始增长,基本上到1月5日回归正常。之前发现挪威2016年月销售量是低于2015年的,后来发现可能跟GDP有关。
gdp_df = pd.read_csv('../datas/GDP_data_2015_to_2019_Finland_Norway_Sweden.csv') gdp_df.set_index('year', inplace=True) gdp_df
至此,我们完成了初步的数据分析。接下来我们将会使用时间序列和线性回归来尝试拟合数据。下一节:Kaggle Tabular Playground Series - Jan 2022 学习笔记2(使用时间序列的线性回归) -
winq.tabular.js
2021-06-18 19:46:43前端小型表格 -
Tabular Editor学习笔记_2
2022-01-20 10:13:14学习地址:PowerBI.Tips - Tutorial - Using Scripts in Tabular Editor - YouTube Tabular Editor | Tabular Editor Documentation 系列文章目录 Tabular Editor学习笔记_1 目录 系列文章目录 前言 一、...学习地址:PowerBI.Tips - Tutorial - Using Scripts in Tabular Editor - YouTube
Tabular Editor | Tabular Editor Documentation
系列文章目录
Tabular Editor学习笔记_2_chichi_magic的博客-CSDN博客
Tabular Editor学习笔记_3:警告标志及解决办法_chichi_magic的博客-CSDN博客
目录
前言
表格编辑器是一个非常高效的工具,它是Power BI、分析语义模型和DAX表达式的最佳开发环境。
一、Tabulor Editor是什么?
表格编辑器是 SSDT 的替代编辑器,用于为 Analysis Services 创作表格模型,即使没有工作区服务器也是如此。
表格编辑器 2 是一个开源项目,可以编辑 BIM 文件,而无需访问模型中的任何数据。此脱机功能支持快速更改 BIM 文件,尤其是在操作和管理度量值、计算列、显示文件夹、透视图和翻译时。
表格编辑器 3 是该工具的商业版本,它添加了许多生产力功能、出色的 DAX 编辑器、更好的 UI 和专用支持。
表格编辑器支持兼容级别 1200 或更高版本(JSON 格式),包括计算组所需的 1500 级别。
可以从 GitHub 上的表格编辑器项目下载可执行文件和源代码。
Tabular Editor - SQLBI
https://www.sqlbi.com/tools/tabular-editor/
二、Scripting
平时使用tabular editor编写script之后,注意收集写过的script,可建立一个查询文档,提高开发速率。
1. output()
通过拖拽表的形式到Advanced scripting,然后使用output()函数,可以输出当前表的相关信息
“hello world”.Output();
Model.Tables["Fact"].Measures["total sales"].Output();
2.同时建立多个度量值
在advanced scripting窗口,选择一个sample,可以同时创建多个度量值
多选需要计算的列,执行script
注意下面的hidden按钮是否打开
3.建立多个度量值的同时修改properties
3.1 对数值进行formatting
这里可以对新创建的度量值加一条语句
newMeasure.FormatString = "0.00";
执行之后的结果可以看到
3.2 增加对于度量值的描述
newMeasure.Description = "This measure is the SUM of" + c.Name
3.3 其他properties
对于下面这些描述度量值的内容,都可以在script中进行统一更改
3.4 c.Name 和 c.DaxObjectName的区别
c.Name //Sales Amount, 度量值的名称
c.DaxObjectName //[Sales Amount],引用度量值
4. 同时修改度量值中所有信息
我们知道,当一个table名字改变,或者想要同时修改多个度量值的属性,在power bi中,需要一个一个点击,但是在tabular editor中,我们可以统一修改
4.1 修改所有度量值的描述信息
foreach(var m in Model.AllMeasures)
{
m.Description = m.Expression
}
-
latex表格手把手超详细教程(table, tabular, multirow, multicolumn)
2019-12-27 19:31:01参考LaTeX tables - Tutorial with code examples 先画一张最简单的表格 绘制Latex表格需要用到 table 和 tabular 环境。其中 table 环境里写表格的标题(caption)、表格的偏移之类的。 tabular 环境则是绘制表格的...最近写论文要用latex,实验部分需要画表格,于是百度看了两个多小时的博客,一无所获,全都写的乱七八糟的,越看越烦躁,于是谷歌五分钟,就学会了怎么画表格,下面是我最终画出来的表格:
接着我将讲解如何从零开始绘制一张latex表格,参考LaTeX tables - Tutorial with code examples
先画一张最简单的表格
绘制Latex表格需要用到 table 和 tabular 环境。其中 table 环境里写表格的标题(caption)、表格的偏移之类的。 tabular 环境则是绘制表格的内容。一个简单的表格绘制代码如下所示:
\documentclass{article} \begin{document} \begin{table}[h!] \begin{center} \caption{Your first table.} \begin{tabular}{l|c|r} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between \textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\ $\alpha$ & $\beta$ & $\gamma$ \\ \hline 1 & 1110.1 & a\\ 2 & 10.1 & b\\ 3 & 23.113231 & c\\ \end{tabular} \end{center} \end{table} \end{document}
首先是 table 环境部分,
\begin{center}
让表格居中,\caption{Your first table.}
写表格的标题。然后是 tabular 环境部分,
\begin{tabular}{l|c|r}
这里面的{l|c|r}
,包含了三个字母,代表了表格总共有三列,第一列靠左偏移,第二列居中,第三列靠右偏移。竖线代表列之间用线分隔开来,如果想要左右两边都用线包围起来,应该改成{|l|c|r|}
。接下来就是正式的表格绘制部分。latex里的表格是一行行来绘制的,每一行里面用
&
来分隔各个元素,用\\
来结束当前这一行的绘制。代码中\textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\
绘制表格的第一行,是三个加粗的字符串。第二行$\alpha$ & $\beta$ & $\gamma$ \\
则是三个希腊字符。接着是
\hline
,它的作用是画一整条横线,注意如果想画一条只经过部分列的横线,则可以用cline{a-b}
,代表的是画一条从第a列到第b列的横线。至此就画完了表头部分,接下来填充表格数据,这个很简单,看代码即可。
简单的表格画完了,但是完全不能满足需求,我需要用到的是一个更复杂的表格形式,一个表格单元占据了多个行或者列。
表格单元占据多个行或者列
这里需要用到
multirow
和multicolumn
,首先要引入相关的包:%... \usepackage{multirow} % Required for multirows \begin{document} %...
multirow
和multicolumn
的格式如下:\multirow{NUMBER_OF_ROWS}{WIDTH}{CONTENT}
NUMBER_OF_ROWS代表该表格单元占据的行数,WIDTH代表表格的宽度,一般填 * 代表自动宽度,CONTENT则是表格单元里的内容。
\multicolumn{NUMBER_OF_COLUMNS}{ALIGNMENT}{CONTENT}
NUMBER_OF_COLUMNS代表该表格单元占据的列数,ALIGNMENT代表表格内容的偏移(填l,c或者r),CONTENT则是表格单元里的内容。
一个multirow的例子
%... \begin{table}[h!] \begin{center} \caption{Multirow table.} \label{tab:table1} \begin{tabular}{l|S|r} \textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\ $\alpha$ & $\beta$ & $\gamma$ \\ \hline \multirow{2}{*}{12} & 1110.1 & a\\ % <-- Combining 2 rows with arbitrary with (*) and content 12 & 10.1 & b\\ % <-- Content of first column omitted. \hline 3 & 23.113231 & c\\ 4 & 25.113231 & d\\ \end{tabular} \end{center} \end{table} %...
主要是这一句代码
\multirow{2}{*}{12} & 1110.1 & a\\
,使得内容为 12 的这一个表格单元占据了两行。注意的是,下一行的第一个位置,由于已经被 12 这个单元给占据了,因此第二行的代码是& 10.1 & b\\
,这里第一个位置没有写东西,如果写了东西会使得这一行超过3列,表格错位。一个multicolumn的例子
%... \begin{table}[h!] \begin{center} \caption{Multicolumn table.} \label{tab:table1} \begin{tabular}{l|S|r} \textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\ $\alpha$ & $\beta$ & $\gamma$ \\ \hline \multicolumn{2}{c|}{12} & a\\ % <-- Combining two cells with alignment c| and content 12. \hline 2 & 10.1 & b\\ 3 & 23.113231 & c\\ 4 & 25.113231 & d\\ \end{tabular} \end{center} \end{table} %...
这里主要是这一句代码
\multicolumn{2}{c|}{12} & a\\
,使得内容为 12 的这一个表格单元占据了两列。所以这一行接下来只能填一个元素a
。注意这里的ALIGNMENT写的是c|
代表表格内容居中,表格右侧有竖线而左侧没有。结合multirow与multicolumn
可以看到我所需要画的表格中,内容为
Model
的这个表格单元需要同时占据两行和两列,这是最复杂的。其实只需要把\multirow{NUMBER_OF_ROWS}{WIDTH}{CONTENT}
的CONTENT写成multicolumn
就可以了。%... \begin{table}[h!] \begin{center} \caption{Multirow and -column table.} \label{tab:table1} \begin{tabular}{l|S|r} \textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\ $\alpha$ & $\beta$ & $\gamma$ \\ \hline \multicolumn{2}{c|}{\multirow{2}{*}{1234}} & a\\ % <-- Multicolumn spanning 2 columns, content multirow spanning two rows \multicolumn{2}{c|}{} & b\\ % <-- Multicolumn spanning 2 columns with empty content as placeholder \hline 3 & 23.113231 & c\\ 4 & 25.113231 & d\\ \end{tabular} \end{center} \end{table} %...
最主要的语句
\multicolumn{2}{c|}{\multirow{2}{*}{1234}} & a\\
使得内容为1234
的表格单元占据了2行两列,所以当前这一行右边只能再写一个元素a
了,然后注意的是下一行是\multicolumn{2}{c|}{} & b\\
用一个空的multicolumn来代表前两个位置空置,然后填剩下的一个元素b
。我的表格实例代码
\begin{table*}[t] \centering \caption{MAP scores of teacher model, different student models with 4 widths and three baseline models with different length of binary codes on CIFAR-10 and SUN datasets.} \label{table1} \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|} \hline \multicolumn{2}{|c|}{\multirow{2}{*}{Model}} &\multirow{2}{*}{FLOPs}&\multirow{2}{*}{Params} & \multicolumn{4}{c|}{CIFAR-10}&\multicolumn{4}{c|}{SUN}\\ \cline{5-12} \multicolumn{2}{|c|}{} & & & 12bits & 24bits & 32bits & 48bits & 12bits & 24bits & 32bits & 48bits \\ \hline \multicolumn{2}{|c|}{Teacher} &4.12G &25.56M &0.87841 &0.89512 &0.9014 &0.90601 &0.83587 &0.85736 &0.86297 &0.87103\\ \hline %0.25x----------------- \multirow{4}{*}{$0.25\times$} & Stu-1 & 0.15G & 1.03M & 0.70746 & 0.73458 & 0.74909 & 0.75833 & 0.69618 & 0.76631 & 0.78075 & 0.78787 \\ \cline{2-12} \multirow{4}{*}{} & Stu-2 &0.19G &1.08M &0.7629 &0.79111 &0.80039 &0.80519 &0.73539 &0.79714 &0.80753 &0.81195\\ \cline{2-12} \multirow{4}{*}{} & Stu-3 &0.26G &1.43M &0.84684 &0.86443 &0.87384 &0.88268 &0.79284 &0.83442 &0.84350 &0.84353\\ \cline{2-12} \multirow{4}{*}{} & Stu-4 & 0.29G &1.99M &0.85901 &0.87269 &0.8836 &0.88728 &0.81997 &0.84620 &0.85041 &0.85036\\ \hline \end{tabular} \label{table_MAP} \end{table*}
这里我用
\begin{table*}[t]
有一个星号,是为了让表格宽度与页面等宽而不是二分之一宽。latex的基本画法就差不多这样了,如果还有更高的需求,最好去谷歌查询,因为百度出来的博客写的实在太烂了,排版混乱,不知所云,看了也是浪费时间。
-
Getting tabular data-crx插件
2021-04-04 05:02:30Get tabular data. You can get data in json or csv format. You can also download [json|csv,xlsx] format files。… Get tabular data. You can get data in json or csv format. You can also download [json|... -
htmx-tabular
2021-03-25 13:59:40htmx-tabular -
Tabular Editor学习笔记_1
2022-01-19 22:08:40Power BI+tabular editor -
SQL Server 2012 Tutorials - Analysis Services Tabular Modeling
2013-06-10 11:05:04SQL Server 2012 Tutorials - Analysis Services Tabular Modeling -
map-tabular-keys:转换表格对象流的键
2021-06-02 20:50:11var map = require ( 'map-tabular-keys' ) , snake = require ( 'snake-case' ) , from = require ( 'from2-array' ) , concat = require ( 'concat-stream' ) from . obj ( [ { 'column a' : 3 , columnB : ... -
tabular-json:展平复杂的JSON对象并转换为csv,制表符分隔或html
2021-04-29 22:36:19var tabular = require ( 'tabular-json' ) ; 职能 flatten(obj, options) -转换为数组。 每行都是一个对象。 array(obj, options) -转换为数组。 每行是一个子数组。 delimit(obj, options) -转换为带分隔符的... -
tabular_cleanse:python脚本,根据python语言规范,将制表符转换为源文件中的空格-python source file
2021-03-25 07:52:32tabular_cleanse.py是您的tabular_cleanse.py之选。 用法 tabular_cleanse.py是一个简单的python脚本,可以根据上述语言规范来解释选项卡。 它非常简单,只需输入stdin并将其发送到stdout: cat scri