@@ -245,13 +245,17 @@ blockToMs opts (Table _ blkCapt specs thead tbody tfoot) =
245245 aligncode AlignDefault = "l"
246246 in do
247247 caption' <- inlineListToMs' opts caption
248− let iwidths = if all (== 0) widths
249− then repeat ""
250− else map (T.pack . printf "w(%0.1fn)" . (70 *)) widths
248+ let isSimple = all (== 0) widths
249+ let totalWidth = 70
251250 -- 78n default width - 8n indent = 70n
252251 let coldescriptions = literal $ T.unwords
253− (zipWith (\align width -> aligncode align <> width)
254− alignments iwidths) <> "."
252+ (zipWith (\align width -> aligncode align <>
253+ if width == 0
254+ then ""
255+ else T.pack $
256+ printf "w(%0.1fn)"
257+ (totalWidth * width))
258+ alignments widths) <> "."
255259 colheadings <- mapM (blockListToMs opts) headers
256260 let makeRow cols = literal "T{" $$
257261 vcat (intersperse (literal "T}\tT{") cols) $$
@@ -260,13 +264,25 @@ blockToMs opts (Table _ blkCapt specs thead tbody tfoot) =
260264 then empty
261265 else makeRow colheadings $$ char '_'
262266 body <- mapM (\row -> do
263− cols <- mapM (blockListToMs opts) row
267+ cols <- mapM (\(cell, w) ->
268+ (if isSimple
269+ then id
270+ else (literal (".nr LL " <>
271+ T.pack (printf "%0.1fn"
272+ (w * totalWidth))) $$)) <$>
273+ blockListToMs opts cell) (zip row widths)
264274 return $ makeRow cols) rows
265275 setFirstPara
266276 return $ literal ".PP" $$ caption' $$
267277 literal ".na" $$ -- we don't want justification in table cells
278+ (if isSimple
279+ then ""
280+ else ".nr LLold \\n[LL]") $$
268281 literal ".TS" $$ literal "delim(@@) tab(\t);" $$ coldescriptions $$
269282 colheadings' $$ vcat body $$ literal ".TE" $$
283+ (if isSimple
284+ then ""
285+ else ".nr LL \\n[LLold]") $$
270286 literal ".ad"
271287
272288blockToMs opts (BulletList items) = do