git.iko.soy/typeable/pandoc
on master help sign in
JATS writer: support advanced table features
d286242Albert Krewinkel
.github/workflows/format-validation.yml+21−10
@@ -10,6 +10,9 @@ on:
10 - 'test/writer.jats_publishing'
10 - 'test/writer.jats_publishing'
11 - 'test/writer.jats_archiving'
11 - 'test/writer.jats_archiving'
12 - 'test/tables.jats_archiving'
12 - 'test/tables.jats_archiving'
13+ - 'test/tables/nordics.jats_archiving'
14+ - 'test/tables/planets.jats_archiving'
15+ - 'test/tables/students.jats_archiving'
13 pull_request:
16 pull_request:
14 branches:
17 branches:
15 - '*'
18 - '*'
@@ -19,6 +22,9 @@ on:
19 - 'test/writer.jats_publishing'
22 - 'test/writer.jats_publishing'
20 - 'test/writer.jats_archiving'
23 - 'test/writer.jats_archiving'
21 - 'test/tables.jats_archiving'
24 - 'test/tables.jats_archiving'
25+ - 'test/tables/nordics.jats_archiving'
26+ - 'test/tables/planets.jats_archiving'
27+ - 'test/tables/students.jats_archiving'
22
28
23jobs:
29jobs:
24 jats:
30 jats:
@@ -65,13 +71,18 @@ jobs:
65 EOF
71 EOF
66 )"
72 )"
67 jats_file="$(mktemp jats-tables.XXXXX)"
73 jats_file="$(mktemp jats-tables.XXXXX)"
74+ exit_code=0
75+ for f in tables tables/nordics tables/planets tables/students; do
76+ filename=test/$f.jats_archiving
77+ printf "Validating %s...\n" "$filename"
68− printf "$tmpl" "$(cat test/tables.jats_archiving)" > "$jats_file"
78+ printf "$tmpl" "$(cat $filename)" > "$jats_file"
69− json="$(curl --form "xml=@${jats_file}" --silent "$VALIDATOR_URL")"
79+ json="$(curl --form "xml=@${jats_file}" --silent "$VALIDATOR_URL")"
70− err_count="$(printf "%s" "$json" | jq '.errors | length')"
80+ err_count="$(printf "%s" "$json" | jq '.errors | length')"
71− if [ "$err_count" -eq 0 ]; then
81+ if [ "$err_count" -eq 0 ]; then
72− printf "Table output is valid when used as body content.\n"
82+ printf "Table output is valid when used as body content.\n"
73− exit 0
74− else
83+ else
75− printf "Validator report:\n%s" "$json"
84+ printf "Validator report:\n%s" "$json"
76− exit 1
85+ exit_code=1
77− fi
86+ fi
87+ done
88+ exit "$exit_code"
src/Text/Pandoc/Writers/JATS.hs+3−2
@@ -46,6 +46,7 @@ import Text.Pandoc.Writers.Math
46import Text.Pandoc.Writers.Shared
46import Text.Pandoc.Writers.Shared
47import Text.Pandoc.XML
47import Text.Pandoc.XML
48import Text.TeXMath
48import Text.TeXMath
49+import qualified Text.Pandoc.Writers.AnnotatedTable as Ann
49import qualified Text.XML.Light as Xml
50import qualified Text.XML.Light as Xml
50
51
51-- | Convert a @'Pandoc'@ document to JATS (Archiving and Interchange
52-- | Convert a @'Pandoc'@ document to JATS (Archiving and Interchange
@@ -349,8 +350,8 @@ blockToJATS _ b@(RawBlock f str)
349 report $ BlockNotRendered b
350 report $ BlockNotRendered b
350 return empty
351 return empty
351blockToJATS _ HorizontalRule = return empty -- not semantic
352blockToJATS _ HorizontalRule = return empty -- not semantic
352−blockToJATS opts (Table attr blkCapt specs th tb tf) =
353+blockToJATS opts (Table attr caption colspecs thead tbody tfoot) =
353− tableToJATS opts attr blkCapt specs th tb tf
354+ tableToJATS opts (Ann.toTable attr caption colspecs thead tbody tfoot)
354
355
355-- | Convert a list of inline elements to JATS.
356-- | Convert a list of inline elements to JATS.
356inlinesToJATS :: PandocMonad m => WriterOptions -> [Inline] -> JATS m (Doc Text)
357inlinesToJATS :: PandocMonad m => WriterOptions -> [Inline] -> JATS m (Doc Text)
src/Text/Pandoc/Writers/JATS/Table.hs+214−48
@@ -1,4 +1,6 @@
1+{-# LANGUAGE LambdaCase #-}
1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE OverloadedStrings #-}
3+{-# LANGUAGE TupleSections #-}
2{- |
4{- |
3 Module : Text.Pandoc.Writers.JATS.Table
5 Module : Text.Pandoc.Writers.JATS.Table
4 Copyright : © 2020 Albert Krewinkel
6 Copyright : © 2020 Albert Krewinkel
@@ -14,69 +16,233 @@ module Text.Pandoc.Writers.JATS.Table
14 ( tableToJATS
16 ( tableToJATS
15 ) where
17 ) where
16import Control.Monad.Reader (asks)
18import Control.Monad.Reader (asks)
19+import Data.List.NonEmpty (NonEmpty ((:|)))
17import Data.Text (Text)
20import Data.Text (Text)
21+import Text.DocLayout (Doc, empty, vcat, ($$))
18import Text.Pandoc.Class.PandocMonad (PandocMonad)
22import Text.Pandoc.Class.PandocMonad (PandocMonad)
19import Text.Pandoc.Definition
23import Text.Pandoc.Definition
20import Text.Pandoc.Options (WriterOptions)
24import Text.Pandoc.Options (WriterOptions)
21−import Text.DocLayout (Doc, empty, vcat, ($$))
22import Text.Pandoc.Shared (tshow)
25import Text.Pandoc.Shared (tshow)
23import Text.Pandoc.Writers.JATS.Types
26import Text.Pandoc.Writers.JATS.Types
24−import Text.Pandoc.Writers.Shared (toLegacyTable)
25import Text.Pandoc.XML (inTags, inTagsIndented, selfClosingTag)
27import Text.Pandoc.XML (inTags, inTagsIndented, selfClosingTag)
26−
28+import qualified Data.Text as T
29+import qualified Text.Pandoc.Writers.AnnotatedTable as Ann
27
30
28tableToJATS :: PandocMonad m
31tableToJATS :: PandocMonad m
29 => WriterOptions
32 => WriterOptions
30− -> Attr -> Caption -> [ColSpec] -> TableHead
33+ -> Ann.Table
31− -> [TableBody] -> TableFoot
32 -> JATS m (Doc Text)
34 -> JATS m (Doc Text)
33−tableToJATS opts _attr blkCapt specs th tb tf = do
35+tableToJATS opts (Ann.Table attr caption colspecs thead tbodies tfoot) = do
34− blockToJATS <- asks jatsBlockWriter
36+ let (Caption _maybeShortCaption captionBlocks) = caption
35− let (caption, aligns, widths, headers, rows) =
37+ tbl <- captionlessTable opts attr colspecs thead tbodies tfoot
36− toLegacyTable blkCapt specs th tb tf
37− captionDoc <- if null caption
38+ captionDoc <- if null captionBlocks
38− then return mempty
39+ then return empty
40+ else do
41+ blockToJATS <- asks jatsBlockWriter
39− else inTagsIndented "caption" <$> blockToJATS opts (Para caption)
42+ inTagsIndented "caption" . vcat <$>
40− tbl <- captionlessTable aligns widths headers rows
43+ mapM (blockToJATS opts) captionBlocks
41 return $ inTags True "table-wrap" [] $ captionDoc $$ tbl
44 return $ inTags True "table-wrap" [] $ captionDoc $$ tbl
45+
46+captionlessTable :: PandocMonad m
47+ => WriterOptions
48+ -> Attr
49+ -> [ColSpec]
50+ -> Ann.TableHead
51+ -> [Ann.TableBody]
52+ -> Ann.TableFoot
53+ -> JATS m (Doc Text)
54+captionlessTable opts attr colspecs thead tbodies tfoot = do
55+ head' <- tableHeadToJats opts thead
56+ bodies <- mapM (tableBodyToJats opts) tbodies
57+ foot' <- tableFootToJats opts tfoot
58+ let validAttribs = [ "border", "cellpadding", "cellspacing", "content-type"
59+ , "frame", "rules", "specific-use", "style", "summary"
60+ , "width"
61+ ]
62+ let attribs = toAttribs attr validAttribs
63+ return $ inTags True "table" attribs $ vcat
64+ [ colSpecListToJATS colspecs
65+ , head'
66+ , foot'
67+ , vcat bodies
68+ ]
69+
70+validTablePartAttribs :: [Text]
71+validTablePartAttribs =
72+ [ "align", "char", "charoff", "content-type", "style", "valign" ]
73+
74+tableBodyToJats :: PandocMonad m
75+ => WriterOptions
76+ -> Ann.TableBody
77+ -> JATS m (Doc Text)
78+tableBodyToJats opts (Ann.TableBody attr _rowHeadCols inthead rows) = do
79+ let attribs = toAttribs attr validTablePartAttribs
80+ intermediateHead <- if null inthead
81+ then return mempty
82+ else headerRowsToJats opts Thead inthead
83+ bodyRows <- bodyRowsToJats opts rows
84+ return $ inTags True "tbody" attribs $ intermediateHead $$ bodyRows
85+
86+tableHeadToJats :: PandocMonad m
87+ => WriterOptions
88+ -> Ann.TableHead
89+ -> JATS m (Doc Text)
90+tableHeadToJats opts (Ann.TableHead attr rows) =
91+ tablePartToJats opts Thead attr rows
92+
93+tableFootToJats :: PandocMonad m
94+ => WriterOptions
95+ -> Ann.TableFoot
96+ -> JATS m (Doc Text)
97+tableFootToJats opts (Ann.TableFoot attr rows) =
98+ tablePartToJats opts Tfoot attr rows
99+
100+tablePartToJats :: PandocMonad m
101+ => WriterOptions
102+ -> TablePart
103+ -> Attr
104+ -> [Ann.HeaderRow]
105+ -> JATS m (Doc Text)
106+tablePartToJats opts tblpart attr rows =
107+ if null rows || all isEmptyRow rows
108+ then return mempty
109+ else do
110+ let tag' = case tblpart of
111+ Thead -> "thead"
112+ Tfoot -> "tfoot"
113+ Tbody -> "tbody" -- this would be unexpected
114+ let attribs = toAttribs attr validTablePartAttribs
115+ inTags True tag' attribs <$> headerRowsToJats opts tblpart rows
42 where
116 where
43− captionlessTable aligns widths headers rows = do
117+ isEmptyRow (Ann.HeaderRow _attr _rownum cells) = all isEmptyCell cells
118+ isEmptyCell (Ann.Cell _colspecs _colnum cell) =
119+ cell == Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) []
120+
121+-- | The part of a table; header, footer, or body.
122+data TablePart = Thead | Tfoot | Tbody
123+ deriving (Eq)
124+
125+data CellType = HeaderCell | BodyCell
126+
127+data TableRow = TableRow TablePart Attr Ann.RowNumber Ann.RowHead Ann.RowBody
128+
129+headerRowsToJats :: PandocMonad m
130+ => WriterOptions
131+ -> TablePart
132+ -> [Ann.HeaderRow]
133+ -> JATS m (Doc Text)
134+headerRowsToJats opts tablepart =
135+ rowListToJats opts . map toTableRow
136+ where
137+ toTableRow (Ann.HeaderRow attr rownum rowbody) =
138+ TableRow tablepart attr rownum [] rowbody
139+
140+bodyRowsToJats :: PandocMonad m
141+ => WriterOptions
142+ -> [Ann.BodyRow]
143+ -> JATS m (Doc Text)
144+bodyRowsToJats opts =
145+ rowListToJats opts . zipWith toTableRow [1..]
146+ where
147+ toTableRow rownum (Ann.BodyRow attr _rownum rowhead rowbody) =
148+ TableRow Tbody attr rownum rowhead rowbody
149+
150+rowListToJats :: PandocMonad m
151+ => WriterOptions
152+ -> [TableRow]
153+ -> JATS m (Doc Text)
154+rowListToJats opts = fmap vcat . mapM (tableRowToJats opts)
155+
156+colSpecListToJATS :: [ColSpec] -> Doc Text
157+colSpecListToJATS colspecs =
158+ let hasDefaultWidth (_, ColWidthDefault) = True
159+ hasDefaultWidth _ = False
160+
44− let percent w = tshow (truncate (100*w) :: Integer) <> "*"
161+ percent w = tshow (round (100*w) :: Integer) <> "%"
45− let coltags = vcat $ zipWith (\w al -> selfClosingTag "col"
162+
163+ col :: ColWidth -> Doc Text
164+ col = selfClosingTag "col" . \case
165+ ColWidthDefault -> mempty
46− ([("width", percent w) | w > 0] ++
166+ ColWidth w -> [("width", percent w)]
47− [("align", alignmentToText al)])) widths aligns
167+
48− thead <- if all null headers
168+ in if all hasDefaultWidth colspecs
49− then return empty
169+ then mempty
50− else inTagsIndented "thead" <$> tableRowToJATS opts True headers
170+ else inTags True "colgroup" [] $ vcat $ map (col . snd) colspecs
51− tbody <- inTagsIndented "tbody" . vcat <$>
171+
52− mapM (tableRowToJATS opts False) rows
53− return $ inTags True "table" [] $ coltags $$ thead $$ tbody
54−
55−alignmentToText :: Alignment -> Text
56−alignmentToText alignment = case alignment of
57− AlignLeft -> "left"
58− AlignRight -> "right"
59− AlignCenter -> "center"
60− AlignDefault -> "left"
61−
62−tableRowToJATS :: PandocMonad m
172+tableRowToJats :: PandocMonad m
63 => WriterOptions
173 => WriterOptions
64− -> Bool
174+ -> TableRow
65− -> [[Block]]
66 -> JATS m (Doc Text)
175 -> JATS m (Doc Text)
67−tableRowToJATS opts isHeader cols =
176+tableRowToJats opts (TableRow tblpart attr _rownum rowhead rowbody) = do
68− inTagsIndented "tr" . vcat <$> mapM (tableItemToJATS opts isHeader) cols
177+ let validAttribs = [ "align", "char", "charoff", "content-type"
178+ , "style", "valign"
179+ ]
180+ let attr' = toAttribs attr validAttribs
181+ let celltype = case tblpart of
182+ Thead -> HeaderCell
183+ _ -> BodyCell
184+ headcells <- mapM (cellToJats opts HeaderCell) rowhead
185+ bodycells <- mapM (cellToJats opts celltype) rowbody
186+ return $ inTags True "tr" attr' $ mconcat
187+ [ vcat headcells
188+ , vcat bodycells
189+ ]
190+
191+alignmentAttrib :: Alignment -> Maybe (Text, Text)
192+alignmentAttrib = fmap ("align",) . \case
193+ AlignLeft -> Just "left"
194+ AlignRight -> Just "right"
195+ AlignCenter -> Just "center"
196+ AlignDefault -> Nothing
197+
198+colspanAttrib :: ColSpan -> Maybe (Text, Text)
199+colspanAttrib = \case
200+ ColSpan 1 -> Nothing
201+ ColSpan n -> Just ("colspan", tshow n)
202+
203+rowspanAttrib :: RowSpan -> Maybe (Text, Text)
204+rowspanAttrib = \case
205+ RowSpan 1 -> Nothing
206+ RowSpan n -> Just ("rowspan", tshow n)
207+
208+cellToJats :: PandocMonad m
209+ => WriterOptions
210+ -> CellType
211+ -> Ann.Cell
212+ -> JATS m (Doc Text)
213+cellToJats opts celltype (Ann.Cell (colspec :| _) _colNum cell) =
214+ let align = fst colspec
215+ in tableCellToJats opts celltype align cell
216+
217+toAttribs :: Attr -> [Text] -> [(Text, Text)]
218+toAttribs (ident, _classes, kvs) knownAttribs =
219+ (if T.null ident then id else (("id", ident) :)) $
220+ filter ((`elem` knownAttribs) . fst) kvs
69
221
70−tableItemToJATS :: PandocMonad m
222+tableCellToJats :: PandocMonad m
71 => WriterOptions
223 => WriterOptions
72− -> Bool
224+ -> CellType
73− -> [Block]
225+ -> Alignment
226+ -> Cell
74 -> JATS m (Doc Text)
227 -> JATS m (Doc Text)
75−tableItemToJATS opts isHeader [Plain item] = do
228+tableCellToJats opts ctype colAlign (Cell attr align rowspan colspan item) = do
76− inlinesToJATS <- asks jatsInlinesWriter
229+ blockToJats <- asks jatsBlockWriter
77− inTags False (if isHeader then "th" else "td") [] <$>
230+ inlinesToJats <- asks jatsInlinesWriter
78− inlinesToJATS opts item
231+ let cellContents = \case
79−tableItemToJATS opts isHeader item = do
232+ [Plain inlines] -> inlinesToJats opts inlines
80− blockToJATS <- asks jatsBlockWriter
233+ blocks -> vcat <$> mapM (blockToJats opts) blocks
81− inTags False (if isHeader then "th" else "td") [] . vcat <$>
234+ let tag' = case ctype of
82− mapM (blockToJATS opts) item
235+ BodyCell -> "td"
236+ HeaderCell -> "th"
237+ let align' = case align of
238+ AlignDefault -> colAlign
239+ _ -> align
240+ let maybeCons = maybe id (:)
241+ let validAttribs = [ "abbr", "align", "axis", "char", "charoff"
242+ , "content-type", "headers", "scope", "style", "valign"
243+ ]
244+ let attribs = maybeCons (alignmentAttrib align')
245+ . maybeCons (rowspanAttrib rowspan)
246+ . maybeCons (colspanAttrib colspan)
247+ $ toAttribs attr validAttribs
248+ inTags False tag' attribs <$> cellContents item
test/Tests/Old.hs+1−1
@@ -101,7 +101,7 @@ tests pandocPath =
101 , testGroup "jats"
101 , testGroup "jats"
102 [ testGroup "writer"
102 [ testGroup "writer"
103 [ testGroup "jats_archiving" $
103 [ testGroup "jats_archiving" $
104− writerTests' "jats_archiving"
104+ extWriterTests' "jats_archiving"
105 , testGroup "jats_articleauthoring" $
105 , testGroup "jats_articleauthoring" $
106 writerTests' "jats_articleauthoring"
106 writerTests' "jats_articleauthoring"
107 , testGroup "jats_publishing" $
107 , testGroup "jats_publishing" $
test/tables.jats_archiving+98−106
@@ -4,35 +4,31 @@
4 <p>Demonstration of simple table syntax.</p>
4 <p>Demonstration of simple table syntax.</p>
5 </caption>
5 </caption>
6 <table>
6 <table>
7− <col align="right" />
8− <col align="left" />
9− <col align="center" />
10− <col align="left" />
11 <thead>
7 <thead>
12 <tr>
8 <tr>
13− <th>Right</th>
9+ <th align="right">Right</th>
14− <th>Left</th>
10+ <th align="left">Left</th>
15− <th>Center</th>
11+ <th align="center">Center</th>
16 <th>Default</th>
12 <th>Default</th>
17 </tr>
13 </tr>
18 </thead>
14 </thead>
19 <tbody>
15 <tbody>
20 <tr>
16 <tr>
21− <td>12</td>
17+ <td align="right">12</td>
22− <td>12</td>
18+ <td align="left">12</td>
23− <td>12</td>
19+ <td align="center">12</td>
24 <td>12</td>
20 <td>12</td>
25 </tr>
21 </tr>
26 <tr>
22 <tr>
27− <td>123</td>
23+ <td align="right">123</td>
28− <td>123</td>
24+ <td align="left">123</td>
29− <td>123</td>
25+ <td align="center">123</td>
30 <td>123</td>
26 <td>123</td>
31 </tr>
27 </tr>
32 <tr>
28 <tr>
33− <td>1</td>
29+ <td align="right">1</td>
34− <td>1</td>
30+ <td align="left">1</td>
35− <td>1</td>
31+ <td align="center">1</td>
36 <td>1</td>
32 <td>1</td>
37 </tr>
33 </tr>
38 </tbody>
34 </tbody>
@@ -41,35 +37,31 @@
41<p>Simple table without caption:</p>
37<p>Simple table without caption:</p>
42<table-wrap>
38<table-wrap>
43 <table>
39 <table>
44− <col align="right" />
45− <col align="left" />
46− <col align="center" />
47− <col align="left" />
48 <thead>
40 <thead>
49 <tr>
41 <tr>
50− <th>Right</th>
42+ <th align="right">Right</th>
51− <th>Left</th>
43+ <th align="left">Left</th>
52− <th>Center</th>
44+ <th align="center">Center</th>
53 <th>Default</th>
45 <th>Default</th>
54 </tr>
46 </tr>
55 </thead>
47 </thead>
56 <tbody>
48 <tbody>
57 <tr>
49 <tr>
58− <td>12</td>
50+ <td align="right">12</td>
59− <td>12</td>
51+ <td align="left">12</td>
60− <td>12</td>
52+ <td align="center">12</td>
61 <td>12</td>
53 <td>12</td>
62 </tr>
54 </tr>
63 <tr>
55 <tr>
64− <td>123</td>
56+ <td align="right">123</td>
65− <td>123</td>
57+ <td align="left">123</td>
66− <td>123</td>
58+ <td align="center">123</td>
67 <td>123</td>
59 <td>123</td>
68 </tr>
60 </tr>
69 <tr>
61 <tr>
70− <td>1</td>
62+ <td align="right">1</td>
71− <td>1</td>
63+ <td align="left">1</td>
72− <td>1</td>
64+ <td align="center">1</td>
73 <td>1</td>
65 <td>1</td>
74 </tr>
66 </tr>
75 </tbody>
67 </tbody>
@@ -81,35 +73,31 @@
81 <p>Demonstration of simple table syntax.</p>
73 <p>Demonstration of simple table syntax.</p>
82 </caption>
74 </caption>
83 <table>
75 <table>
84− <col align="right" />
85− <col align="left" />
86− <col align="center" />
87− <col align="left" />
88 <thead>
76 <thead>
89 <tr>
77 <tr>
90− <th>Right</th>
78+ <th align="right">Right</th>
91− <th>Left</th>
79+ <th align="left">Left</th>
92− <th>Center</th>
80+ <th align="center">Center</th>
93 <th>Default</th>
81 <th>Default</th>
94 </tr>
82 </tr>
95 </thead>
83 </thead>
96 <tbody>
84 <tbody>
97 <tr>
85 <tr>
98− <td>12</td>
86+ <td align="right">12</td>
99− <td>12</td>
87+ <td align="left">12</td>
100− <td>12</td>
88+ <td align="center">12</td>
101 <td>12</td>
89 <td>12</td>
102 </tr>
90 </tr>
103 <tr>
91 <tr>
104− <td>123</td>
92+ <td align="right">123</td>
105− <td>123</td>
93+ <td align="left">123</td>
106− <td>123</td>
94+ <td align="center">123</td>
107 <td>123</td>
95 <td>123</td>
108 </tr>
96 </tr>
109 <tr>
97 <tr>
110− <td>1</td>
98+ <td align="right">1</td>
111− <td>1</td>
99+ <td align="left">1</td>
112− <td>1</td>
100+ <td align="center">1</td>
113 <td>1</td>
101 <td>1</td>
114 </tr>
102 </tr>
115 </tbody>
103 </tbody>
@@ -121,30 +109,33 @@
121 <p>Here’s the caption. It may span multiple lines.</p>
109 <p>Here’s the caption. It may span multiple lines.</p>
122 </caption>
110 </caption>
123 <table>
111 <table>
112+ <colgroup>
124− <col width="15*" align="center" />
113+ <col width="15%" />
125− <col width="13*" align="left" />
114+ <col width="14%" />
126− <col width="16*" align="right" />
115+ <col width="16%" />
127− <col width="35*" align="left" />
116+ <col width="35%" />
117+ </colgroup>
128 <thead>
118 <thead>
129 <tr>
119 <tr>
130− <th>Centered Header</th>
120+ <th align="center">Centered Header</th>
131− <th>Left Aligned</th>
121+ <th align="left">Left Aligned</th>
132− <th>Right Aligned</th>
122+ <th align="right">Right Aligned</th>
133− <th>Default aligned</th>
123+ <th align="left">Default aligned</th>
134 </tr>
124 </tr>
135 </thead>
125 </thead>
136 <tbody>
126 <tbody>
137 <tr>
127 <tr>
138− <td>First</td>
128+ <td align="center">First</td>
139− <td>row</td>
129+ <td align="left">row</td>
140− <td>12.0</td>
130+ <td align="right">12.0</td>
141− <td>Example of a row that spans multiple lines.</td>
131+ <td align="left">Example of a row that spans multiple lines.</td>
142 </tr>
132 </tr>
143 <tr>
133 <tr>
144− <td>Second</td>
134+ <td align="center">Second</td>
145− <td>row</td>
135+ <td align="left">row</td>
146− <td>5.0</td>
136+ <td align="right">5.0</td>
147− <td>Here’s another one. Note the blank line between rows.</td>
137+ <td align="left">Here’s another one. Note the blank line between
138+ rows.</td>
148 </tr>
139 </tr>
149 </tbody>
140 </tbody>
150 </table>
141 </table>
@@ -152,30 +143,33 @@
152<p>Multiline table without caption:</p>
143<p>Multiline table without caption:</p>
153<table-wrap>
144<table-wrap>
154 <table>
145 <table>
146+ <colgroup>
155− <col width="15*" align="center" />
147+ <col width="15%" />
156− <col width="13*" align="left" />
148+ <col width="14%" />
157− <col width="16*" align="right" />
149+ <col width="16%" />
158− <col width="35*" align="left" />
150+ <col width="35%" />
151+ </colgroup>
159 <thead>
152 <thead>
160 <tr>
153 <tr>
161− <th>Centered Header</th>
154+ <th align="center">Centered Header</th>
162− <th>Left Aligned</th>
155+ <th align="left">Left Aligned</th>
163− <th>Right Aligned</th>
156+ <th align="right">Right Aligned</th>
164− <th>Default aligned</th>
157+ <th align="left">Default aligned</th>
165 </tr>
158 </tr>
166 </thead>
159 </thead>
167 <tbody>
160 <tbody>
168 <tr>
161 <tr>
169− <td>First</td>
162+ <td align="center">First</td>
170− <td>row</td>
163+ <td align="left">row</td>
171− <td>12.0</td>
164+ <td align="right">12.0</td>
172− <td>Example of a row that spans multiple lines.</td>
165+ <td align="left">Example of a row that spans multiple lines.</td>
173 </tr>
166 </tr>
174 <tr>
167 <tr>
175− <td>Second</td>
168+ <td align="center">Second</td>
176− <td>row</td>
169+ <td align="left">row</td>
177− <td>5.0</td>
170+ <td align="right">5.0</td>
178− <td>Here’s another one. Note the blank line between rows.</td>
171+ <td align="left">Here’s another one. Note the blank line between
172+ rows.</td>
179 </tr>
173 </tr>
180 </tbody>
174 </tbody>
181 </table>
175 </table>
@@ -183,28 +177,24 @@
183<p>Table without column headers:</p>
177<p>Table without column headers:</p>
184<table-wrap>
178<table-wrap>
185 <table>
179 <table>
186− <col align="right" />
187− <col align="left" />
188− <col align="center" />
189− <col align="right" />
190 <tbody>
180 <tbody>
191 <tr>
181 <tr>
192− <td>12</td>
182+ <td align="right">12</td>
193− <td>12</td>
183+ <td align="left">12</td>
194− <td>12</td>
184+ <td align="center">12</td>
195− <td>12</td>
185+ <td align="right">12</td>
196 </tr>
186 </tr>
197 <tr>
187 <tr>
198− <td>123</td>
188+ <td align="right">123</td>
199− <td>123</td>
189+ <td align="left">123</td>
200− <td>123</td>
190+ <td align="center">123</td>
201− <td>123</td>
191+ <td align="right">123</td>
202 </tr>
192 </tr>
203 <tr>
193 <tr>
204− <td>1</td>
194+ <td align="right">1</td>
205− <td>1</td>
195+ <td align="left">1</td>
206− <td>1</td>
196+ <td align="center">1</td>
207− <td>1</td>
197+ <td align="right">1</td>
208 </tr>
198 </tr>
209 </tbody>
199 </tbody>
210 </table>
200 </table>
@@ -212,21 +202,23 @@
212<p>Multiline table without column headers:</p>
202<p>Multiline table without column headers:</p>
213<table-wrap>
203<table-wrap>
214 <table>
204 <table>
205+ <colgroup>
215− <col width="15*" align="center" />
206+ <col width="15%" />
216− <col width="13*" align="left" />
207+ <col width="14%" />
217− <col width="16*" align="right" />
208+ <col width="16%" />
218− <col width="35*" align="left" />
209+ <col width="35%" />
210+ </colgroup>
219 <tbody>
211 <tbody>
220 <tr>
212 <tr>
221− <td>First</td>
213+ <td align="center">First</td>
222− <td>row</td>
214+ <td align="left">row</td>
223− <td>12.0</td>
215+ <td align="right">12.0</td>
224 <td>Example of a row that spans multiple lines.</td>
216 <td>Example of a row that spans multiple lines.</td>
225 </tr>
217 </tr>
226 <tr>
218 <tr>
227− <td>Second</td>
219+ <td align="center">Second</td>
228− <td>row</td>
220+ <td align="left">row</td>
229− <td>5.0</td>
221+ <td align="right">5.0</td>
230 <td>Here’s another one. Note the blank line between rows.</td>
222 <td>Here’s another one. Note the blank line between rows.</td>
231 </tr>
223 </tr>
232 </tbody>
224 </tbody>
test/tables.jats_articleauthoring+98−106
@@ -4,35 +4,31 @@
4 <p>Demonstration of simple table syntax.</p>
4 <p>Demonstration of simple table syntax.</p>
5 </caption>
5 </caption>
6 <table>
6 <table>
7− <col align="right" />
8− <col align="left" />
9− <col align="center" />
10− <col align="left" />
11 <thead>
7 <thead>
12 <tr>
8 <tr>
13− <th>Right</th>
9+ <th align="right">Right</th>
14− <th>Left</th>
10+ <th align="left">Left</th>
15− <th>Center</th>
11+ <th align="center">Center</th>
16 <th>Default</th>
12 <th>Default</th>
17 </tr>
13 </tr>
18 </thead>
14 </thead>
19 <tbody>
15 <tbody>
20 <tr>
16 <tr>
21− <td>12</td>
17+ <td align="right">12</td>
22− <td>12</td>
18+ <td align="left">12</td>
23− <td>12</td>
19+ <td align="center">12</td>
24 <td>12</td>
20 <td>12</td>
25 </tr>
21 </tr>
26 <tr>
22 <tr>
27− <td>123</td>
23+ <td align="right">123</td>
28− <td>123</td>
24+ <td align="left">123</td>
29− <td>123</td>
25+ <td align="center">123</td>
30 <td>123</td>
26 <td>123</td>
31 </tr>
27 </tr>
32 <tr>
28 <tr>
33− <td>1</td>
29+ <td align="right">1</td>
34− <td>1</td>
30+ <td align="left">1</td>
35− <td>1</td>
31+ <td align="center">1</td>
36 <td>1</td>
32 <td>1</td>
37 </tr>
33 </tr>
38 </tbody>
34 </tbody>
@@ -41,35 +37,31 @@
41<p>Simple table without caption:</p>
37<p>Simple table without caption:</p>
42<table-wrap>
38<table-wrap>
43 <table>
39 <table>
44− <col align="right" />
45− <col align="left" />
46− <col align="center" />
47− <col align="left" />
48 <thead>
40 <thead>
49 <tr>
41 <tr>
50− <th>Right</th>
42+ <th align="right">Right</th>
51− <th>Left</th>
43+ <th align="left">Left</th>
52− <th>Center</th>
44+ <th align="center">Center</th>
53 <th>Default</th>
45 <th>Default</th>
54 </tr>
46 </tr>
55 </thead>
47 </thead>
56 <tbody>
48 <tbody>
57 <tr>
49 <tr>
58− <td>12</td>
50+ <td align="right">12</td>
59− <td>12</td>
51+ <td align="left">12</td>
60− <td>12</td>
52+ <td align="center">12</td>
61 <td>12</td>
53 <td>12</td>
62 </tr>
54 </tr>
63 <tr>
55 <tr>
64− <td>123</td>
56+ <td align="right">123</td>
65− <td>123</td>
57+ <td align="left">123</td>
66− <td>123</td>
58+ <td align="center">123</td>
67 <td>123</td>
59 <td>123</td>
68 </tr>
60 </tr>
69 <tr>
61 <tr>
70− <td>1</td>
62+ <td align="right">1</td>
71− <td>1</td>
63+ <td align="left">1</td>
72− <td>1</td>
64+ <td align="center">1</td>
73 <td>1</td>
65 <td>1</td>
74 </tr>
66 </tr>
75 </tbody>
67 </tbody>
@@ -81,35 +73,31 @@
81 <p>Demonstration of simple table syntax.</p>
73 <p>Demonstration of simple table syntax.</p>
82 </caption>
74 </caption>
83 <table>
75 <table>
84− <col align="right" />
85− <col align="left" />
86− <col align="center" />
87− <col align="left" />
88 <thead>
76 <thead>
89 <tr>
77 <tr>
90− <th>Right</th>
78+ <th align="right">Right</th>
91− <th>Left</th>
79+ <th align="left">Left</th>
92− <th>Center</th>
80+ <th align="center">Center</th>
93 <th>Default</th>
81 <th>Default</th>
94 </tr>
82 </tr>
95 </thead>
83 </thead>
96 <tbody>
84 <tbody>
97 <tr>
85 <tr>
98− <td>12</td>
86+ <td align="right">12</td>
99− <td>12</td>
87+ <td align="left">12</td>
100− <td>12</td>
88+ <td align="center">12</td>
101 <td>12</td>
89 <td>12</td>
102 </tr>
90 </tr>
103 <tr>
91 <tr>
104− <td>123</td>
92+ <td align="right">123</td>
105− <td>123</td>
93+ <td align="left">123</td>
106− <td>123</td>
94+ <td align="center">123</td>
107 <td>123</td>
95 <td>123</td>
108 </tr>
96 </tr>
109 <tr>
97 <tr>
110− <td>1</td>
98+ <td align="right">1</td>
111− <td>1</td>
99+ <td align="left">1</td>
112− <td>1</td>
100+ <td align="center">1</td>
113 <td>1</td>
101 <td>1</td>
114 </tr>
102 </tr>
115 </tbody>
103 </tbody>
@@ -121,30 +109,33 @@
121 <p>Here’s the caption. It may span multiple lines.</p>
109 <p>Here’s the caption. It may span multiple lines.</p>
122 </caption>
110 </caption>
123 <table>
111 <table>
112+ <colgroup>
124− <col width="15*" align="center" />
113+ <col width="15%" />
125− <col width="13*" align="left" />
114+ <col width="14%" />
126− <col width="16*" align="right" />
115+ <col width="16%" />
127− <col width="35*" align="left" />
116+ <col width="35%" />
117+ </colgroup>
128 <thead>
118 <thead>
129 <tr>
119 <tr>
130− <th>Centered Header</th>
120+ <th align="center">Centered Header</th>
131− <th>Left Aligned</th>
121+ <th align="left">Left Aligned</th>
132− <th>Right Aligned</th>
122+ <th align="right">Right Aligned</th>
133− <th>Default aligned</th>
123+ <th align="left">Default aligned</th>
134 </tr>
124 </tr>
135 </thead>
125 </thead>
136 <tbody>
126 <tbody>
137 <tr>
127 <tr>
138− <td>First</td>
128+ <td align="center">First</td>
139− <td>row</td>
129+ <td align="left">row</td>
140− <td>12.0</td>
130+ <td align="right">12.0</td>
141− <td>Example of a row that spans multiple lines.</td>
131+ <td align="left">Example of a row that spans multiple lines.</td>
142 </tr>
132 </tr>
143 <tr>
133 <tr>
144− <td>Second</td>
134+ <td align="center">Second</td>
145− <td>row</td>
135+ <td align="left">row</td>
146− <td>5.0</td>
136+ <td align="right">5.0</td>
147− <td>Here’s another one. Note the blank line between rows.</td>
137+ <td align="left">Here’s another one. Note the blank line between
138+ rows.</td>
148 </tr>
139 </tr>
149 </tbody>
140 </tbody>
150 </table>
141 </table>
@@ -152,30 +143,33 @@
152<p>Multiline table without caption:</p>
143<p>Multiline table without caption:</p>
153<table-wrap>
144<table-wrap>
154 <table>
145 <table>
146+ <colgroup>
155− <col width="15*" align="center" />
147+ <col width="15%" />
156− <col width="13*" align="left" />
148+ <col width="14%" />
157− <col width="16*" align="right" />
149+ <col width="16%" />
158− <col width="35*" align="left" />
150+ <col width="35%" />
151+ </colgroup>
159 <thead>
152 <thead>
160 <tr>
153 <tr>
161− <th>Centered Header</th>
154+ <th align="center">Centered Header</th>
162− <th>Left Aligned</th>
155+ <th align="left">Left Aligned</th>
163− <th>Right Aligned</th>
156+ <th align="right">Right Aligned</th>
164− <th>Default aligned</th>
157+ <th align="left">Default aligned</th>
165 </tr>
158 </tr>
166 </thead>
159 </thead>
167 <tbody>
160 <tbody>
168 <tr>
161 <tr>
169− <td>First</td>
162+ <td align="center">First</td>
170− <td>row</td>
163+ <td align="left">row</td>
171− <td>12.0</td>
164+ <td align="right">12.0</td>
172− <td>Example of a row that spans multiple lines.</td>
165+ <td align="left">Example of a row that spans multiple lines.</td>
173 </tr>
166 </tr>
174 <tr>
167 <tr>
175− <td>Second</td>
168+ <td align="center">Second</td>
176− <td>row</td>
169+ <td align="left">row</td>
177− <td>5.0</td>
170+ <td align="right">5.0</td>
178− <td>Here’s another one. Note the blank line between rows.</td>
171+ <td align="left">Here’s another one. Note the blank line between
172+ rows.</td>
179 </tr>
173 </tr>
180 </tbody>
174 </tbody>
181 </table>
175 </table>
@@ -183,28 +177,24 @@
183<p>Table without column headers:</p>
177<p>Table without column headers:</p>
184<table-wrap>
178<table-wrap>
185 <table>
179 <table>
186− <col align="right" />
187− <col align="left" />
188− <col align="center" />
189− <col align="right" />
190 <tbody>
180 <tbody>
191 <tr>
181 <tr>
192− <td>12</td>
182+ <td align="right">12</td>
193− <td>12</td>
183+ <td align="left">12</td>
194− <td>12</td>
184+ <td align="center">12</td>
195− <td>12</td>
185+ <td align="right">12</td>
196 </tr>
186 </tr>
197 <tr>
187 <tr>
198− <td>123</td>
188+ <td align="right">123</td>
199− <td>123</td>
189+ <td align="left">123</td>
200− <td>123</td>
190+ <td align="center">123</td>
201− <td>123</td>
191+ <td align="right">123</td>
202 </tr>
192 </tr>
203 <tr>
193 <tr>
204− <td>1</td>
194+ <td align="right">1</td>
205− <td>1</td>
195+ <td align="left">1</td>
206− <td>1</td>
196+ <td align="center">1</td>
207− <td>1</td>
197+ <td align="right">1</td>
208 </tr>
198 </tr>
209 </tbody>
199 </tbody>
210 </table>
200 </table>
@@ -212,21 +202,23 @@
212<p>Multiline table without column headers:</p>
202<p>Multiline table without column headers:</p>
213<table-wrap>
203<table-wrap>
214 <table>
204 <table>
205+ <colgroup>
215− <col width="15*" align="center" />
206+ <col width="15%" />
216− <col width="13*" align="left" />
207+ <col width="14%" />
217− <col width="16*" align="right" />
208+ <col width="16%" />
218− <col width="35*" align="left" />
209+ <col width="35%" />
210+ </colgroup>
219 <tbody>
211 <tbody>
220 <tr>
212 <tr>
221− <td>First</td>
213+ <td align="center">First</td>
222− <td>row</td>
214+ <td align="left">row</td>
223− <td>12.0</td>
215+ <td align="right">12.0</td>
224 <td>Example of a row that spans multiple lines.</td>
216 <td>Example of a row that spans multiple lines.</td>
225 </tr>
217 </tr>
226 <tr>
218 <tr>
227− <td>Second</td>
219+ <td align="center">Second</td>
228− <td>row</td>
220+ <td align="left">row</td>
229− <td>5.0</td>
221+ <td align="right">5.0</td>
230 <td>Here’s another one. Note the blank line between rows.</td>
222 <td>Here’s another one. Note the blank line between rows.</td>
231 </tr>
223 </tr>
232 </tbody>
224 </tbody>
test/tables.jats_publishing+98−106
@@ -4,35 +4,31 @@
4 <p>Demonstration of simple table syntax.</p>
4 <p>Demonstration of simple table syntax.</p>
5 </caption>
5 </caption>
6 <table>
6 <table>
7− <col align="right" />
8− <col align="left" />
9− <col align="center" />
10− <col align="left" />
11 <thead>
7 <thead>
12 <tr>
8 <tr>
13− <th>Right</th>
9+ <th align="right">Right</th>
14− <th>Left</th>
10+ <th align="left">Left</th>
15− <th>Center</th>
11+ <th align="center">Center</th>
16 <th>Default</th>
12 <th>Default</th>
17 </tr>
13 </tr>
18 </thead>
14 </thead>
19 <tbody>
15 <tbody>
20 <tr>
16 <tr>
21− <td>12</td>
17+ <td align="right">12</td>
22− <td>12</td>
18+ <td align="left">12</td>
23− <td>12</td>
19+ <td align="center">12</td>
24 <td>12</td>
20 <td>12</td>
25 </tr>
21 </tr>
26 <tr>
22 <tr>
27− <td>123</td>
23+ <td align="right">123</td>
28− <td>123</td>
24+ <td align="left">123</td>
29− <td>123</td>
25+ <td align="center">123</td>
30 <td>123</td>
26 <td>123</td>
31 </tr>
27 </tr>
32 <tr>
28 <tr>
33− <td>1</td>
29+ <td align="right">1</td>
34− <td>1</td>
30+ <td align="left">1</td>
35− <td>1</td>
31+ <td align="center">1</td>
36 <td>1</td>
32 <td>1</td>
37 </tr>
33 </tr>
38 </tbody>
34 </tbody>
@@ -41,35 +37,31 @@
41<p>Simple table without caption:</p>
37<p>Simple table without caption:</p>
42<table-wrap>
38<table-wrap>
43 <table>
39 <table>
44− <col align="right" />
45− <col align="left" />
46− <col align="center" />
47− <col align="left" />
48 <thead>
40 <thead>
49 <tr>
41 <tr>
50− <th>Right</th>
42+ <th align="right">Right</th>
51− <th>Left</th>
43+ <th align="left">Left</th>
52− <th>Center</th>
44+ <th align="center">Center</th>
53 <th>Default</th>
45 <th>Default</th>
54 </tr>
46 </tr>
55 </thead>
47 </thead>
56 <tbody>
48 <tbody>
57 <tr>
49 <tr>
58− <td>12</td>
50+ <td align="right">12</td>
59− <td>12</td>
51+ <td align="left">12</td>
60− <td>12</td>
52+ <td align="center">12</td>
61 <td>12</td>
53 <td>12</td>
62 </tr>
54 </tr>
63 <tr>
55 <tr>
64− <td>123</td>
56+ <td align="right">123</td>
65− <td>123</td>
57+ <td align="left">123</td>
66− <td>123</td>
58+ <td align="center">123</td>
67 <td>123</td>
59 <td>123</td>
68 </tr>
60 </tr>
69 <tr>
61 <tr>
70− <td>1</td>
62+ <td align="right">1</td>
71− <td>1</td>
63+ <td align="left">1</td>
72− <td>1</td>
64+ <td align="center">1</td>
73 <td>1</td>
65 <td>1</td>
74 </tr>
66 </tr>
75 </tbody>
67 </tbody>
@@ -81,35 +73,31 @@
81 <p>Demonstration of simple table syntax.</p>
73 <p>Demonstration of simple table syntax.</p>
82 </caption>
74 </caption>
83 <table>
75 <table>
84− <col align="right" />
85− <col align="left" />
86− <col align="center" />
87− <col align="left" />
88 <thead>
76 <thead>
89 <tr>
77 <tr>
90− <th>Right</th>
78+ <th align="right">Right</th>
91− <th>Left</th>
79+ <th align="left">Left</th>
92− <th>Center</th>
80+ <th align="center">Center</th>
93 <th>Default</th>
81 <th>Default</th>
94 </tr>
82 </tr>
95 </thead>
83 </thead>
96 <tbody>
84 <tbody>
97 <tr>
85 <tr>
98− <td>12</td>
86+ <td align="right">12</td>
99− <td>12</td>
87+ <td align="left">12</td>
100− <td>12</td>
88+ <td align="center">12</td>
101 <td>12</td>
89 <td>12</td>
102 </tr>
90 </tr>
103 <tr>
91 <tr>
104− <td>123</td>
92+ <td align="right">123</td>
105− <td>123</td>
93+ <td align="left">123</td>
106− <td>123</td>
94+ <td align="center">123</td>
107 <td>123</td>
95 <td>123</td>
108 </tr>
96 </tr>
109 <tr>
97 <tr>
110− <td>1</td>
98+ <td align="right">1</td>
111− <td>1</td>
99+ <td align="left">1</td>
112− <td>1</td>
100+ <td align="center">1</td>
113 <td>1</td>
101 <td>1</td>
114 </tr>
102 </tr>
115 </tbody>
103 </tbody>
@@ -121,30 +109,33 @@
121 <p>Here’s the caption. It may span multiple lines.</p>
109 <p>Here’s the caption. It may span multiple lines.</p>
122 </caption>
110 </caption>
123 <table>
111 <table>
112+ <colgroup>
124− <col width="15*" align="center" />
113+ <col width="15%" />
125− <col width="13*" align="left" />
114+ <col width="14%" />
126− <col width="16*" align="right" />
115+ <col width="16%" />
127− <col width="35*" align="left" />
116+ <col width="35%" />
117+ </colgroup>
128 <thead>
118 <thead>
129 <tr>
119 <tr>
130− <th>Centered Header</th>
120+ <th align="center">Centered Header</th>
131− <th>Left Aligned</th>
121+ <th align="left">Left Aligned</th>
132− <th>Right Aligned</th>
122+ <th align="right">Right Aligned</th>
133− <th>Default aligned</th>
123+ <th align="left">Default aligned</th>
134 </tr>
124 </tr>
135 </thead>
125 </thead>
136 <tbody>
126 <tbody>
137 <tr>
127 <tr>
138− <td>First</td>
128+ <td align="center">First</td>
139− <td>row</td>
129+ <td align="left">row</td>
140− <td>12.0</td>
130+ <td align="right">12.0</td>
141− <td>Example of a row that spans multiple lines.</td>
131+ <td align="left">Example of a row that spans multiple lines.</td>
142 </tr>
132 </tr>
143 <tr>
133 <tr>
144− <td>Second</td>
134+ <td align="center">Second</td>
145− <td>row</td>
135+ <td align="left">row</td>
146− <td>5.0</td>
136+ <td align="right">5.0</td>
147− <td>Here’s another one. Note the blank line between rows.</td>
137+ <td align="left">Here’s another one. Note the blank line between
138+ rows.</td>
148 </tr>
139 </tr>
149 </tbody>
140 </tbody>
150 </table>
141 </table>
@@ -152,30 +143,33 @@
152<p>Multiline table without caption:</p>
143<p>Multiline table without caption:</p>
153<table-wrap>
144<table-wrap>
154 <table>
145 <table>
146+ <colgroup>
155− <col width="15*" align="center" />
147+ <col width="15%" />
156− <col width="13*" align="left" />
148+ <col width="14%" />
157− <col width="16*" align="right" />
149+ <col width="16%" />
158− <col width="35*" align="left" />
150+ <col width="35%" />
151+ </colgroup>
159 <thead>
152 <thead>
160 <tr>
153 <tr>
161− <th>Centered Header</th>
154+ <th align="center">Centered Header</th>
162− <th>Left Aligned</th>
155+ <th align="left">Left Aligned</th>
163− <th>Right Aligned</th>
156+ <th align="right">Right Aligned</th>
164− <th>Default aligned</th>
157+ <th align="left">Default aligned</th>
165 </tr>
158 </tr>
166 </thead>
159 </thead>
167 <tbody>
160 <tbody>
168 <tr>
161 <tr>
169− <td>First</td>
162+ <td align="center">First</td>
170− <td>row</td>
163+ <td align="left">row</td>
171− <td>12.0</td>
164+ <td align="right">12.0</td>
172− <td>Example of a row that spans multiple lines.</td>
165+ <td align="left">Example of a row that spans multiple lines.</td>
173 </tr>
166 </tr>
174 <tr>
167 <tr>
175− <td>Second</td>
168+ <td align="center">Second</td>
176− <td>row</td>
169+ <td align="left">row</td>
177− <td>5.0</td>
170+ <td align="right">5.0</td>
178− <td>Here’s another one. Note the blank line between rows.</td>
171+ <td align="left">Here’s another one. Note the blank line between
172+ rows.</td>
179 </tr>
173 </tr>
180 </tbody>
174 </tbody>
181 </table>
175 </table>
@@ -183,28 +177,24 @@
183<p>Table without column headers:</p>
177<p>Table without column headers:</p>
184<table-wrap>
178<table-wrap>
185 <table>
179 <table>
186− <col align="right" />
187− <col align="left" />
188− <col align="center" />
189− <col align="right" />
190 <tbody>
180 <tbody>
191 <tr>
181 <tr>
192− <td>12</td>
182+ <td align="right">12</td>
193− <td>12</td>
183+ <td align="left">12</td>
194− <td>12</td>
184+ <td align="center">12</td>
195− <td>12</td>
185+ <td align="right">12</td>
196 </tr>
186 </tr>
197 <tr>
187 <tr>
198− <td>123</td>
188+ <td align="right">123</td>
199− <td>123</td>
189+ <td align="left">123</td>
200− <td>123</td>
190+ <td align="center">123</td>
201− <td>123</td>
191+ <td align="right">123</td>
202 </tr>
192 </tr>
203 <tr>
193 <tr>
204− <td>1</td>
194+ <td align="right">1</td>
205− <td>1</td>
195+ <td align="left">1</td>
206− <td>1</td>
196+ <td align="center">1</td>
207− <td>1</td>
197+ <td align="right">1</td>
208 </tr>
198 </tr>
209 </tbody>
199 </tbody>
210 </table>
200 </table>
@@ -212,21 +202,23 @@
212<p>Multiline table without column headers:</p>
202<p>Multiline table without column headers:</p>
213<table-wrap>
203<table-wrap>
214 <table>
204 <table>
205+ <colgroup>
215− <col width="15*" align="center" />
206+ <col width="15%" />
216− <col width="13*" align="left" />
207+ <col width="14%" />
217− <col width="16*" align="right" />
208+ <col width="16%" />
218− <col width="35*" align="left" />
209+ <col width="35%" />
210+ </colgroup>
219 <tbody>
211 <tbody>
220 <tr>
212 <tr>
221− <td>First</td>
213+ <td align="center">First</td>
222− <td>row</td>
214+ <td align="left">row</td>
223− <td>12.0</td>
215+ <td align="right">12.0</td>
224 <td>Example of a row that spans multiple lines.</td>
216 <td>Example of a row that spans multiple lines.</td>
225 </tr>
217 </tr>
226 <tr>
218 <tr>
227− <td>Second</td>
219+ <td align="center">Second</td>
228− <td>row</td>
220+ <td align="left">row</td>
229− <td>5.0</td>
221+ <td align="right">5.0</td>
230 <td>Here’s another one. Note the blank line between rows.</td>
222 <td>Here’s another one. Note the blank line between rows.</td>
231 </tr>
223 </tr>
232 </tbody>
224 </tbody>
test/tables/nordics.jats_archivingnew file+58
@@ -0,0 +1,58 @@
1+<table-wrap>
2+ <caption>
3+ <p>States belonging to the <italic>Nordics.</italic></p>
4+ </caption>
5+ <table id="nordics">
6+ <colgroup>
7+ <col width="30%" />
8+ <col width="30%" />
9+ <col width="20%" />
10+ <col width="20%" />
11+ </colgroup>
12+ <thead>
13+ <tr>
14+ <th align="center">Name</th>
15+ <th align="center">Capital</th>
16+ <th align="center">Population
17+ (in 2018)</th>
18+ <th align="center">Area
19+ (in km<sup>2</sup>)</th>
20+ </tr>
21+ </thead>
22+ <tfoot>
23+ <tr id="summary">
24+ <td align="center">Total</td>
25+ <td align="left"></td>
26+ <td align="left" id="total-population">27,376,022</td>
27+ <td align="left" id="total-area">1,258,336</td>
28+ </tr>
29+ </tfoot>
30+ <tbody>
31+ <tr>
32+ <th align="center">Denmark</th><td align="left">Copenhagen</td>
33+ <td align="left">5,809,502</td>
34+ <td align="left">43,094</td>
35+ </tr>
36+ <tr>
37+ <th align="center">Finland</th><td align="left">Helsinki</td>
38+ <td align="left">5,537,364</td>
39+ <td align="left">338,145</td>
40+ </tr>
41+ <tr>
42+ <th align="center">Iceland</th><td align="left">Reykjavik</td>
43+ <td align="left">343,518</td>
44+ <td align="left">103,000</td>
45+ </tr>
46+ <tr>
47+ <th align="center">Norway</th><td align="left">Oslo</td>
48+ <td align="left">5,372,191</td>
49+ <td align="left">323,802</td>
50+ </tr>
51+ <tr>
52+ <th align="center">Sweden</th><td align="left">Stockholm</td>
53+ <td align="left">10,313,447</td>
54+ <td align="left">450,295</td>
55+ </tr>
56+ </tbody>
57+ </table>
58+</table-wrap>
test/tables/planets.jats_archivingnew file+128
@@ -0,0 +1,128 @@
1+<table-wrap>
2+ <caption>
3+ <p>Data about the planets of our solar system.</p>
4+ </caption>
5+ <table>
6+ <thead>
7+ <tr>
8+ <th align="center" colspan="2"></th>
9+ <th>Name</th>
10+ <th align="right">Mass (10^24kg)</th>
11+ <th align="right">Diameter (km)</th>
12+ <th align="right">Density (kg/m^3)</th>
13+ <th align="right">Gravity (m/s^2)</th>
14+ <th align="right">Length of day (hours)</th>
15+ <th align="right">Distance from Sun (10^6km)</th>
16+ <th align="right">Mean temperature (C)</th>
17+ <th align="right">Number of moons</th>
18+ <th>Notes</th>
19+ </tr>
20+ </thead>
21+ <tbody>
22+ <tr>
23+ <th align="center" rowspan="4" colspan="2">Terrestrial planets</th>
24+ <th>Mercury</th><td align="right">0.330</td>
25+ <td align="right">4,879</td>
26+ <td align="right">5427</td>
27+ <td align="right">3.7</td>
28+ <td align="right">4222.6</td>
29+ <td align="right">57.9</td>
30+ <td align="right">167</td>
31+ <td align="right">0</td>
32+ <td>Closest to the Sun</td>
33+ </tr>
34+ <tr>
35+ <th>Venus</th><td align="right">4.87</td>
36+ <td align="right">12,104</td>
37+ <td align="right">5243</td>
38+ <td align="right">8.9</td>
39+ <td align="right">2802.0</td>
40+ <td align="right">108.2</td>
41+ <td align="right">464</td>
42+ <td align="right">0</td>
43+ <td></td>
44+ </tr>
45+ <tr>
46+ <th>Earth</th><td align="right">5.97</td>
47+ <td align="right">12,756</td>
48+ <td align="right">5514</td>
49+ <td align="right">9.8</td>
50+ <td align="right">24.0</td>
51+ <td align="right">149.6</td>
52+ <td align="right">15</td>
53+ <td align="right">1</td>
54+ <td>Our world</td>
55+ </tr>
56+ <tr>
57+ <th>Mars</th><td align="right">0.642</td>
58+ <td align="right">6,792</td>
59+ <td align="right">3933</td>
60+ <td align="right">3.7</td>
61+ <td align="right">24.7</td>
62+ <td align="right">227.9</td>
63+ <td align="right">-65</td>
64+ <td align="right">2</td>
65+ <td>The red planet</td>
66+ </tr>
67+ <tr>
68+ <th align="center" rowspan="4">Jovian planets</th>
69+ <th align="center" rowspan="2">Gas giants</th>
70+ <th>Jupiter</th><td align="right">1898</td>
71+ <td align="right">142,984</td>
72+ <td align="right">1326</td>
73+ <td align="right">23.1</td>
74+ <td align="right">9.9</td>
75+ <td align="right">778.6</td>
76+ <td align="right">-110</td>
77+ <td align="right">67</td>
78+ <td>The largest planet</td>
79+ </tr>
80+ <tr>
81+ <th>Saturn</th><td align="right">568</td>
82+ <td align="right">120,536</td>
83+ <td align="right">687</td>
84+ <td align="right">9.0</td>
85+ <td align="right">10.7</td>
86+ <td align="right">1433.5</td>
87+ <td align="right">-140</td>
88+ <td align="right">62</td>
89+ <td></td>
90+ </tr>
91+ <tr>
92+ <th align="center" rowspan="2">Ice giants</th>
93+ <th>Uranus</th><td align="right">86.8</td>
94+ <td align="right">51,118</td>
95+ <td align="right">1271</td>
96+ <td align="right">8.7</td>
97+ <td align="right">17.2</td>
98+ <td align="right">2872.5</td>
99+ <td align="right">-195</td>
100+ <td align="right">27</td>
101+ <td></td>
102+ </tr>
103+ <tr>
104+ <th>Neptune</th><td align="right">102</td>
105+ <td align="right">49,528</td>
106+ <td align="right">1638</td>
107+ <td align="right">11.0</td>
108+ <td align="right">16.1</td>
109+ <td align="right">4495.1</td>
110+ <td align="right">-200</td>
111+ <td align="right">14</td>
112+ <td></td>
113+ </tr>
114+ <tr>
115+ <th align="center" colspan="2">Dwarf planets</th>
116+ <th>Pluto</th><td align="right">0.0146</td>
117+ <td align="right">2,370</td>
118+ <td align="right">2095</td>
119+ <td align="right">0.7</td>
120+ <td align="right">153.3</td>
121+ <td align="right">5906.4</td>
122+ <td align="right">-225</td>
123+ <td align="right">5</td>
124+ <td>Declassified as a planet in 2006.</td>
125+ </tr>
126+ </tbody>
127+ </table>
128+</table-wrap>
test/tables/students.jats_archivingnew file+56
@@ -0,0 +1,56 @@
1+<table-wrap>
2+ <caption>
3+ <p>List of Students</p>
4+ </caption>
5+ <table id="students">
6+ <colgroup>
7+ <col width="50%" />
8+ <col width="50%" />
9+ </colgroup>
10+ <thead>
11+ <tr>
12+ <th align="center">Student ID</th>
13+ <th align="center">Name</th>
14+ </tr>
15+ </thead>
16+ <tbody>
17+ <tr>
18+ <th align="left" colspan="2">Computer Science</th>
19+ </tr>
20+ <tr>
21+ <td align="left">3741255</td>
22+ <td align="left">Jones, Martha</td>
23+ </tr>
24+ <tr>
25+ <td align="left">4077830</td>
26+ <td align="left">Pierce, Benjamin</td>
27+ </tr>
28+ <tr>
29+ <td align="left">5151701</td>
30+ <td align="left">Kirk, James</td>
31+ </tr>
32+ </tbody>
33+ <tbody>
34+ <tr>
35+ <th align="left" colspan="2">Russian Literature</th>
36+ </tr>
37+ <tr>
38+ <td align="left">3971244</td>
39+ <td align="left">Nim, Victor</td>
40+ </tr>
41+ </tbody>
42+ <tbody>
43+ <tr>
44+ <th align="left" colspan="2">Astrophysics</th>
45+ </tr>
46+ <tr>
47+ <td align="left">4100332</td>
48+ <td align="left">Petrov, Alexandra</td>
49+ </tr>
50+ <tr>
51+ <td align="left">4100332</td>
52+ <td align="left">Toyota, Hiroko</td>
53+ </tr>
54+ </tbody>
55+ </table>
56+</table-wrap>