From e2fa3cb6ef0e65704402570d56086deca7643828 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 30 Jul 2016 19:41:51 -0400 Subject: [PATCH] Fix output of table borders for XHTML. Fixes bug #10154. --- lib/layouts/stdinsets.inc | 13 +++++++++++++ src/insets/InsetTabular.cpp | 8 +------- src/insets/InsetTabular.h | 3 +++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index a40572f9a8..e6a4641909 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -618,3 +618,16 @@ End InsetLayout PrintNomencl HTMLTag h2 End + +InsetLayout Tabular + HTMLStyle + table { + border-collapse: collapse; + display: inline-block; + } + td { + border: 1px solid black; + padding: 0.5ex; + } + EndHTMLStyle +End diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 2f2c3729f7..e83c895b54 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5092,13 +5092,7 @@ docstring InsetTabular::xhtml(XHTMLStream & xs, OutputParams const & rp) const void InsetTabular::validate(LaTeXFeatures & features) const { tabular.validate(features); - // FIXME XHTML - // It'd be better to be able to get this from an InsetLayout, but at present - // InsetLayouts do not seem really to work for things that aren't InsetTexts. - if (features.runparams().flavor == OutputParams::HTML) - features.addCSSSnippet( - "table { border: 1px solid black; display: inline-block; }\n" - "td { border: 1px solid black; padding: 0.5ex; }"); + features.useInsetLayout(getLayout()); } diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 4b8ce5942f..1e1379cc7b 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -981,6 +981,9 @@ public: void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const; /// virtual bool usePlainLayout() const { return true; } + /// + docstring layoutName() const { return from_ascii("Tabular"); } + /// InsetTabular * asInsetTabular() { return this; } -- 2.39.5