我有一个包含许多列的表,我可以将此表转换为表示相同的信息,但列标题放在行中。示例尝试转换此表:
{| class="wikitable"
! scope="col"| Benchmark
! scope="col"| Total number of transactions
! scope="col"| Device data reads (DMA)
! scope="col"| Device data writes (DMA)
! scope="col"| Uncacheable data reads
! scope="col"| Uncacheable data writes
! scope="col"| Uncacheable instruction fetches
! scope="col"| Data read transactions
! scope="col"| Data read misses
! scope="col"| Data read hit-ratio
! scope="col"| Instruction fetch transactions
! scope="col"| Instruction fetch misses
! scope="col"| Instruction fetch hit-ratio
! scope="col"| Data write transactions
! scope="col"| Data write misses
! scope="col"| Data write hit-ratio
! scope="col"| Copy-back transactions
|-
! scope="row"| Vortex
| 572369
| 0
| 0
| 0
| 0
| 0
| 193418
| 43473
| 77.52%
| 261195
| 103199
| 60.49%
| 117756
| 83646
| 28.97%
| 0
|-
! scope="row"| Equake
|482932
|0
|0
|0
|0
|0
|128014
|16909
|86.79%
|281793
|58486
|79.25%
|73125
|14086
|80.74%
|0
|-
! scope="row"| Parser
|571505
|0
|0
|0
|0
|0
|224470
|26972
|87.98%
|224082
|14404
|93.57%
|122953
|50771
|58.71%
|0
|}
类似于:
{| class="wikitable"
! scope="col"| Benchmark
! scope="col"| Vortex
! scope="col"| Equake
! scope="col"| Parser
|-
.
.
.
模板是否可以执行此操作?
答案 0 :(得分:2)
如果您需要定期自动执行此操作,请查看Scibuntu扩展程序和Lua,并再次询问您是否卡住了!
如果您对JavaScript解决方案感到满意,那么已经有一些SO问题,请参阅例如Convert TD columns into TR rows
答案 1 :(得分:1)
你可以使用模板做一次性:假设你有一个或两个表,你想要维护两个版本,彼此的转置。
我将在en.wikipedia.org/User:Rich Farmbrough / transpose上举个例子